Best practices for deploying Java webapps with minimal downtime?

前端 未结 18 1843
我在风中等你
我在风中等你 2021-01-29 18:28

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 develop
18条回答
  •  深忆病人
    2021-01-29 19:04

    Tomcat 7 has a nice feature called "parallel deployment" that is designed for this use case.

    The gist is that you expand the .war into a directory, either directly under webapps/ or symlinked. Successive versions of the application are in directories named app##version, for example myapp##001 and myapp##002. Tomcat will handle existing sessions going to the old version, and new sessions going to the new version.

    The catch is that you have to be very careful with PermGen leaks. This is especially true with Grails that uses a lot of PermGen. VisualVM is your friend.

提交回复
热议问题