When deploying a large Java webapp (>100 MB .war) I'm currently use the following deployment process:
- The application .war file is expanded locally on the development machine.
- The expanded application is rsync:ed from the development machine to the live environment.
- The app server in the live environment is restarted after the rsync. This step is not strictly needed, but I've found that restarting the application server on deployment avoids "java.lang.OutOfMemoryError: PermGen space" due to frequent class loading.
Good things about this approach:
- The rsync minimizes the amount of data sent from the development machine to the live environment. Uploading the entire .war file takes over ten minutes, whereas an rsync takes a couple of seconds.
Bad things about this approach:
- While the rsync is running the application context is restarted since the files are updated. Ideally the restart should happen after the rsync is complete, not when it is still running.
- The app server restart causes roughly two minutes of downtime.
I'd like to find a deployment process with the following properties:
- Minimal downtime during deployment process.
- Minimal time spent uploading the data.
- If the deployment process is app server specific, then the app server must be open-source.
Question:
- Given the stated requirements, what is the optimal deployment process?