TomcatExpert

JKOptions + DisableReuse benefits over standard connection pool mechanism

posted by SpringSource on October 27, 2009 02:36 PM

Alternative to mod_jk connecting to a Tomcat connection pool

The DisableReuse + JKOption is recommended because of how mod_jk handles connections. Typically the DisableReuse option is recommended when there are issues with keeping a connection alive.

mod_jk has built in health checks:

connect_timeout
prepost_timeout

Both of them do the same thing. They send a PING to Tomcat. Tomcat responds with a PONG. And only then the connection is used as it is considered healthy.

The DisableReuse will close each connection after it has been used. In closing the connection after each use, it achieves two things:

1. Establishing a new TCP connection is equally fast, if not faster, than PING/PONG, as it is handled at the kernel TCP implementation.

2. It frees up threads on the Tomcat server, making those threads available to handle requests from other httpd workers, or possibly, other httpd servers.

Using a connection pool with multiple httpd front ends, one must carefully balance connection pool settings and thread counts on the Tomcat server. The DisableReuse JKOptions setting bypasses the need in balancing the connection pool and thread count settings.

We have not run into a scenario where the creation and break down of TCP sessions caused any performance concerns. Hence, using the setting will have a cleaner and efficient system, with less threads being taken up on the Tomcat side.

 

 

 

mod_jk has built in health checks:

 

connect_timeout

prepost_timeout

 

Both of them do the same thing. They send a PING to Tomcat. Tomcat responds with a PONG. And only then the connection is used as it is considered healthy

For more than 10 years, SpringSource employees have been supporting Apache technologies, with unparalleled experience and commitment to the Apache Software Foundation. More than 400 of the Fortune 500 count on SpringSource to support their mission-critical business applications. Leaders of the Apache Software Foundation, including Board Members, work at SpringSource and dedicate a significant amount of time further developing the Apache Tomcat open source project. Over the last 2 years, 95% of the issues fixed in the Apache Tomcat project were fixed by SpringSource engineers. For more information on how SpringSource can help your enterprise, see the SpringSource website, or call 800/444-1935.

Comments

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.