Friday, December 23, 2005

How do I make Tomcat startup faster

These are placeholders until more detail is entered ...

Get a faster computer

Make sure your code is not doing slow things. (Use a profiler)?


Remove any jar files you don't need. When searching for classes every JAR file needs to be examined to find the needed class. Also during webapp startup, jar files are searched for TLD files. If the jar file is not there - there is nothing to search.


Remove any webapps you don't need. (So remove the all the webapps installed with tomcat)


Tweak memory parameters - Google is your friend.


Trim the config files as much as possible. XML parsing is not cheap. The less there is to parse - the faster things will go.

3 Comments:

At 1:56 PM, Blogger Ripple said...

You should increase JVM memory(heap and stack) size by running Tomcat, just change catalina.bat, add like "SET CATALINA_OPTS=-mx1024m"

 
At 2:01 PM, Blogger Ripple said...

> Is this something that I should worry about? Is it easily resolved? I have
> downloaded and installled Apache Portable Runtiime. It did not install in
> the Java path though?
>

The message has been fixed in 5.5.13. What Tomcat is really looking for is
libtcnative-1.so. To get that, you unpack tomcat-native.tar.gz (in
$CATALINA_HOME/bin), then cd to the directory. From there do:
$ ./configure --with-apr=/path/to/apr --with-ssl=/path/to/OpenSSL
$ make
$ cp libtcnative-1.so ..

> Thanks
>
> Using CATALINA_BASE: /usr/local/tomcat
> Using CATALINA_HOME: /usr/local/tomcat
> Using CATALINA_TMPDIR: /usr/local/tomcat/temp
> Using JRE_HOME: /opt/jdk1.5.0_04/
> Dec 2, 2005 5:20:25 PM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: The Apache Portable Runtime which allows optimal performance in
> production environments
> was not found on the java.library.path:
> /opt/jdk1.5.0_04/jre/lib/i386/client:/opt/jdk1.5.0_0
> 4/jre/lib/i386:/opt/jdk1.5.0_04/jre/../lib/i386
> Dec 2, 2005 5:20:25 PM org.apache.coyote.http11.Http11BaseProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> Dec 2, 2005 5:20:25 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 2370 ms
> Dec 2, 2005 5:20:26 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Dec 2, 2005 5:20:26 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.12
> Dec 2, 2005 5:20:26 PM org.apache

 
At 2:30 PM, Blogger Ripple said...

in catalina.sh CATALINA_OPTS="-Xms64m -Xmx512m"

 

Post a Comment

<< Home