3

I have a tomcat 7 installation on a Solaris 10 server. My problem is that starting the server (or deploying a new war) is extremely slow. It usually take 30 - 60 minutes. The war application is a medium sized grails application so there are quite a a lot of files. The server is running other server applications as well but from my basic skills I don't see this as a problem.

Can anyone give me some tips on how to analyse this? Settings in Tomcat, java, server, disc access or something else?

I use these parameters to tomcat:

CATALINA_OPTS="-Dcom.sun.management.jmxremote=true -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=512m  -XX:MaxPermSize=512m -XX:+DisableExplicitGC"

And I use a 32 bit java 1.6.

Henrik
  • 133
  • 1
  • 1
  • 6
  • 3
    Take a look at `catalina.out` to see where does it hang. – quanta Sep 04 '12 at 06:46
  • It does not say anything. I'm deploying through the manager web ui. Could that be the problem? The actual upload of the war file takes only a couple of seconds, then it hangs and wait. – Henrik Sep 05 '12 at 11:57
  • I think it's something with the grails war file. Deploying the apache solr war file only takes a few seconds. – Henrik Sep 05 '12 at 14:09
  • I found this solution: disable the search component https://github.com/Heliosearch/heliosearch/commit/b43988585f948965a5760bf60314fc76b1c099ff and the document from solr wiki: https://wiki.apache.org/solr/SolrPerformanceProblems#How_much_heap_space_do_I_need.3F – Yuting Woo Jan 19 '15 at 11:34
  • Two things you can see if they help. Does a pre-exploded war directory help improve the time, i.e. You do not deploy a compressed war file, but an uncompressed war directory. Second, not sure, but is there any entropy collection related steps going on in the background? On other full fledged app servers, I've seen that as a possible reason for delayed starts. Any possibility that tomcat servlet container does the same? – yetdot Aug 17 '16 at 10:42
  • Also, to be certain, move this specific war file out of the deployment directory and see if the tomcat server boot time improves. This does not solve your problem, by confirms that there is indeed something in the war file that leads to the slowness. – yetdot Aug 17 '16 at 10:46
  • Also, check the health of the server. Maybe the server is having a shortage of resources( memory or CPU). – Sunil Bhoi Jun 22 '18 at 06:23

3 Answers3

0

Try to precompile Ruby files to Java classes for WAR file. It is done during WAR deployment nevertheless, so for why it take a lot of time... especially on SPARC machines. Offload compilation .rb files from server to your development machine.

nudzo
  • 648
  • 1
  • 6
  • 8
  • It's Grails, not Ruby in Rails. I thought that the Grails war generation already precompliled the gsp files. – Henrik Sep 05 '12 at 11:49
0

While pre-compiling your application might help I doubt it is causing a 30-60 minute delay to do so. Is it possible your application is running a bunch of on-start or data priming tasks that may be causing issues with the initial startup?

Brent Pabst
  • 6,069
  • 2
  • 24
  • 36
  • I have some test data generation in the Bootstrap. But these are quite simple and should not cause this delay. – Henrik Sep 05 '12 at 11:50
0

How long does:

java -version

take to run where java is the java you use for your tomcat?

See this answer:

Performance issue with JVM (1.6.0_22) invoking OS command on Solaris 10

gm3dmo
  • 10,057
  • 1
  • 42
  • 36