Best Practices - Tomcat Performance Tuning For Pentaho
Best Practices - Tomcat Performance Tuning For Pentaho
Best Practices - Tomcat Performance Tuning For Pentaho
Tomcat Performance
Tuning for Pentaho
This page has intentionally been left blank.
Contents
Overview .............................................................................................................................................................. 1
Tuning Tomcat for Performance .................................................................................................................. 2
Choose the Right Connector..................................................................................................................... 2
Set the Right Thread Pool Size ................................................................................................................. 2
Consider Turning-on Compression ......................................................................................................... 3
Host Static Content on a Web Server ...................................................................................................... 3
Conclusion ....................................................................................................................................................... 3
Best Practice Check List ..................................................................................................................................... 4
This page has intentionally been left blank.
Overview
We have collected a set of best practice recommendations for you to leverage when you need to do some
performance tuning for Tomcat.
Some of the things discussed here for tuning Tomcat include choosing the right connector, setting the
correct thread-pool size, and hosting static content on a web server.
The intention of this document is to speak about topics generally; however, these are the specific versions
covered here:
Software Version
Pentaho 6.x, 7.x
Apache Tomcat 7.0, 8.0
More information about the different versions listed above can be found in the Components Reference
documentation on Pentaho’s webpage.
For Tomcat 7, use the org.apache.coyote.http11.Http11NioProtocol with the connector within the
$tomcat/conf/server.xml.
If the solution is expecting ~300 new requests per second with each request requiring 2.5
seconds to complete, eventually, there will be ~750 requests that need to be handled
simultaneously. The server in this situation should have ~750 processing threads at startup
with potentially ~1000 processing threads at maximum to handle excessive loads.
Using a non-blocking Connector may reduce the required amount of threads. However, we
recommend starting with several threads to meet the anticipated concurrent connection
volume and set the maximum to be the anticipated peak with some buffer.
Only reduce the thread count after analyzing the performance and thread usage of the solution under
the anticipated usage load.
The example below sets a Connector with a minimum thread count of 300 and a maximum of 500. The
prestartminSpareThreads attribute will cause the connector to prepopulate the thread pool with the
configured minimum. The maxIdleTime sets the number of milliseconds after which idle threads are
released, allowing the thread pool to shrink as volume decreases.
We recommend enabling compression during the development phase of the solution, but you should
compare it to an uncompressed configuration during testing. It is also possible to set the compression
attribute to a file size, indicating that only files / content larger than this value will be compressed.
Conclusion
The guidelines presented in this document are generic in that they were not written with any particular
solution in mind. They are considered guidelines and a starting point. These guidelines must be tested
and validated within development or QA before being placed into production.
Have you set the right thread pool size? YES ___ NO ___