users@glassfish.java.net

Re: Performance impact of application reloading and auto-deployment?

From: <glassfish_at_javadesktop.org>
Date: Thu, 11 Mar 2010 07:35:05 PST

The advice for disabling these periodic functions is there, as far as I know, to help get the very best performance possible out of your system. If you don't need those features, then turning them off will save at least a little time and improve performance at least slightly.

I'm not aware of any formal (or informal) performance studies of the impact of disabling autodeploy and auto-reload. Here's some background that might help you think about the trade-off.

Each of these features uses a separate thread that runs every few seconds (the frequency is configurable). During each execution, the auto-deploy logic scans the autodeploy directory for any changes - new files added, existing files deleted or updated. For each such change it takes the appropriate action. In the usual steady-state case in which nothing has changed, the cost is the time to scan the files in the autodeploy directory and consult some internal data structures. The actual time this takes will depend on how many files are in that autodeploy directory and what OS you are running (since file operations tend to take different amounts of time on different operating systems).

It's similar for the reload feature. Every few seconds (configurable) a thread scans the top-level directory of all deployed applications looking for a .reload file. If that file exists and is more recent than the previous scan, then the app is redeployed. Again, in the normal steady-state case in which no apps need to be reloaded, the time taken depends on how many apps are deployed and, therefore, how many top-level directories will be checked.

Note that the dynamic reloading feature, despite its name, essentially redeploys the app, so it will have the same outward effect on the availability of the app as if you explicitly redeployed an application.

I know this note contains no numbers for you at all, but maybe by describing what's happening inside it can help you make a (somewhat) better informed choice.

- Tim
[Message sent by forum member 'tjquinn' (timothy.quinn_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=391279