Juraj Martinka
Juraj Martinka

Reputation: 4366

Tomcat 7 ajp connector configuration - deffered initiliazation

We have an Apache server in front of Apache Tomcat Server.

When switching from Tomcat 5.5 to Tomcat 7 we've encountered following behavior. -- Tomcat 5 - no AJP connection is not available until Tomcat is fully started (2-3 minutes in our case). This means that for any request HTTP status 503 is returned. -- Tomcat 7 - AJP connections are initialized at tomcat startup but cannot be handled until Tomcat is fully started. This means that requests are cumulated at Apache server.

We would like to have a similar behavior with Tomcat 7 as was with Tomcat 5.5, i.e. Tomcat will response with 503 HTTP status code to every AJP request until tomcat is fully stared.

Looking at Tomcat 7 AJP connector configuration http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html I don't see any obvious way how to achieve aforementioned behavior. Parameter "bindOnInit" sounds promising but it is already true by default and this obviously does not help.

Upvotes: 3

Views: 1085

Answers (1)

paulcm
paulcm

Reputation: 1754

We have seen the same issue, so I tried setting bindOnInit=false and it actually does seem to give the behaviour that you require (503s from Apache until the webapp has finished starting). The documentation isn't that clear, but I assume that 'initiated' (true) occurs much earlier than 'started' (false). I'll update once we've done some proper testing (with our load balancers).

Upvotes: 2

Related Questions