Question

I develop applications using a customized version of Tomcat. There is support for dynamic class loading, which I use a lot in test and development environments, and I'm curious about the impact of using it in production environment also.

By my knowledge, dynamic class loading is not to be used in production due to performance issues, due to the class loader polling classes at each access.

But, this applcation server support configuration of polling frequency for loading new classes.

If I understand it correctly, if I configure the dynamic class loading to poll every reasonably large amount of time (ie. 1hour) I should avoid most adverse performance impacts.

In production, this mechanism would be used in a limited number of ways:
1) emergency patching without user downtime (fixes would be released at the first shutdown)
2) permanent patching of classes of which we do not have the source (legacy third party libs)

Is this a reliable solution?

Thanks

Was it helpful?

Solution

IMHO you should not use the feature for production.
Apart from the polling overhead there may be lot of other scenario which would not cause problems in a dev environment

Few things that come to my mind are

  1. Impact on any constants that are inlined during compiletime
  2. Impact on perm space
  3. You lose track of the version you have deployed in production
  4. there can be mistakes like missing a classfile during the patch

OTHER TIPS

Without knowing what "customized Tomcat version" you have it is obviously difficult to tell if you understand it correctly. However yes, if it does what it says on the tin, you will be avoiding most advers effects.

Still for Emergegency Pachting and the like, why would you want to wait up to an hour for the classes to be reloaded when you could just use the Tomcat Manager Application as described below?

If you want to use this feature for Emergency patching or generell patching, I would strongly suggest using Tomcat Manager Application to trigger a reload when requried:

reloadable

Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top