A pitfall in upgrading to GF v3 with JK listeners
I had difficulties getting JK listeners working with GFv3 (build 74.2) on RHEL 5.4 64-bit and Sun JDK build 1.6.0_18-b07. I had created a new listener using the following values:
JK Listener: [x] Enabled
I had left all other options as defaults. After restarting Glassfish I could see it was correctly listening on 127.0.0.1:8009. I then configured Apache's mod_proxy_ajp like this:
ProxyPass / ajp://127.0.0.1:8009/ min=0 smax=0 max=1 retry=10 timeout=120 ttl=60 acquire=5000
The above was a configuration which I was successfully using with Glassfish v2.1. With v3 the AJP connectivity started failing after a few requests through Apache. The problem looked like v3 was not releasing the AJP connections correctly or something alike so that mod_proxy_ajp / mod_jk could reuse the connections. But this was simply a symptom.
The default size for the http thread pool in v2.1 was 200 and as far as I know, this pool was also used for JK listeners. In v3 when you create a new JK listener, the thread pool is set to http-thread-pool by default. The default size of this pool, if I recall correctly, is 5! When using Apache in prefork mode, the size of the thread pool should be at least the value of MaxClients when using mod_proxy_ajp or mod_jk.
There was no mention about this change in the release notes, so at least I missed it completely. I hope this posting will help others to avoid this pitfall.