If you have many applications in your jetty server instance, then restarting the server may take a couple of minutes. How can you make applications boot faster after jetty restart?


This may be a poor man's solution but today I came up with this solution:

Move all webapps to the temp folder.
mv /opt/jetty/webapps/* /opt/webapps.tmp/

Restart 'empty' jetty server and wait for the process to finish.
service jetty restart & wait %1

Copy applications back
mv /opt/webapps.tmp/* /opt/jetty/webapps/

This way server restarts in much shorter time, mine does in 1-2 seconds, and each application will become available right after they are loaded by jetty in contrast to all applications becoming available at the same time when each and every application has been loaded.

You could prioritize loading of the application by changing the script stating which applications to copy first and sleep the script for a jetty scan interval in between copying.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.