1
votes

I have a number of different web services developed using the Grails framework (version 2.3.7). Each web service does different things, some simple, some more complex. Some have only a few dependencies (plugins etc.), others many.

For production, I deploy each service/application on Tomcat 7, each on a different VM. To do this, I first build a WAR:

> grails war

and then I deploy the WAR on Tomcat as the ROOT application (/var/lib/tomcat7/webapps/ROOT.war). This works just fine.

But, when (re-)starting Tomcat, it often takes between 2-7 minutes to deploy the application, sometimes more. I haven't noticed a real correlation between the complexity of the application and the deployment time.

What could the reason be for this lengthy deployment time? What should I look at to try to speed up Grails application deployments on Tomcat 7?

Or is this just what I should expect and I should learn to live with it?

1
A typical bare bones Grails 2.x application/WAR will start in about 30 seconds or so. So your start up times are VERY SLOW. What plugins are you using? What code is being run in Bootstrap.groovy? Do any of them depend on external resources (other web services, etc.)? - Joshua Moore
Thanks for confirming that my startup times were way off. I think I found the answer and it can be found below. - metajungle

1 Answers

0
votes

It turned out this problem was related to the "Entropy Source", as documented on the Tomcat wiki on how to speed up starting Tomcat. So the solution was to add the following JDK option to the Tomcat configuration file: /etc/default/tomcat7:

-Djava.security.egd=file:/dev/./urandom

Now Tomcat reliably starts up in around 20-30 seconds.