Tomcat Connector Implementations

In general the APR (Apache Portable Runtime) library is the most efficient connector, as it is a non-blocking C implementation. The Java based, blocking IO implementation, know as Cototye, is considered more stable, but due to its blocking nature is usually not great for high traffic sites. The NIO (New IO) implementation is generally not used, unless you don't have access to the APR library. Tomcat comes with the blocking IO implementation by default.
Once you have chosen the best library to use you can then start tweaking the timeout and keep alive request settings in sever.xml. The general rule of thumb is that for high concurrency sites without SSL use low time outs and keep-alive requests setting and for low concurrency sites or sites with SSL set the time outs  and max requests higher. You should always change the default time out of 20 seconds on the HTTP connector to a lower value.
When using AJP you should set the keep-alive and timeouts to off as usually the web server and Tomcat are on the same machine, making the time to set up and create connections between the two almost irrelevant. Also use Apache to do the SSL in this case and not Tomcat!

No comments:

Post a Comment

Please Provide your feedback here