Go Back   Web Server Hosting Forum by BODHost > Support > Tutorials and Documentation
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-09-09, 19:07
Moderator
 
Join Date: Dec 2008
Posts: 257
Default Tomcat Perfomance enhancement tips

In order to enhance Tomcat for better performance there are few steps to be followed. Only by following these few easy steps you will find Tomcat working finer than ever.

1. Change the thread pool settings of web server or Connector to the most closely request load you have. It is one of the most important step to follow also it is difficult to follow. Connector attribute needed for this is maxThreads. If the settings are too low it means that you don’t have enough threads to handle all the requests and other request will have to wait for some time sitting idle. These requests will sit idle till one of the thread is freed up. If the value is too low then Tomcat will not able to utilize your server machines hardware. Even setting Tomcat to a maximum value will affect the performance. Tomcat will take a bit longer than usual to load and during peak load time server will slow down to crawl to many requests at the same time. Set the values according to your traffic model.

2. Start JVM with a higher heap memory using the -Xmx switch. More memory will be available for Tomcat to use if you set the limit higher using the switch. Also JVM will not invoke garbage collector as often, therefore server can focus a higher percent of its CPU time on serving web requests. Indirectly it means that requests can be completed quickly. If your server is running on a dedicated server hardware then just give the JVM as much as physical memory of the machine is possible. Is it is running on virtual or shared hardware use Tcat Server Console or Jconsole to find out the memory level needed by your webapps under load circumstances.

3. Compression: turning it “on” and “off” may give you surprising results. Find out which of them works fine for you. It is “off” by default.

4. CompressableMimeTypes: once Compression is enabled, this attribute should be set so that Tomcat will find what is that you want to compress. For example: “text/html, text/xml, text/javascript, text/css, text/plain”

5. Enabling the web browser to cache the static content of the webaaps can increase users apparent performance. It will take a lot of time as each of the webapps requires some study of the webapp. Caching is all about right set of response headers and their values when Tomcat is serving webapp’s static files.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 02:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.