Skip to main content

jk_enabled thread leak?

3 replies [Last post]
slominskir
Offline
Joined: 2010-11-15
Points: 0

I setup Glassfish to accept AJP requests from Apache and after a very short while under single user load I'll get a thread pool busy error in the GlassFish log and the application stops working. Is there a thread leak bug in GlassFish?

Increasing the size of the thread pool seems to fix the issue, but will it just run out later on?

More information here: http://stackoverflow.com/questions/7273967/apache-mod-proxy-ajp-with-gla...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
amyroh
Offline
Joined: 2004-05-06
Points: 0

On 9/2/11 10:22 AM, forums@java.net wrote:
> I setup Glassfish to accept AJP requests from Apache and after a very
> short
> while under single user load I'll get a thread pool busy error in the
> GlassFish log and the application stops working. Is there a thread
> leak bug
> in GlassFish?
>
> Increasing the size of the thread pool seems to fix the issue, but
> will it
> just run out later on?

You should be able to resolve this issue by increasing the
max-thread-pool-size to be at least the value of Apache maximum number
of connections. Or you can also set Apache's maximum number of
connections that will be allowed to the backend server by using the max
parameter.

ProxyPass /example http://backend.example.com max=20 ttl=120 retry=300

Amy

>
> More information
> here: http://stackoverflow.com/questions/7273967/apache-mod-proxy-ajp-with-gla...
>
>
>
> --
>
> [Message sent by forum member 'slominskir']
>
> View Post: http://forums.java.net/node/839729
>
>

slominskir
Offline
Joined: 2010-11-15
Points: 0

In an Apache Prefork MPM does setting the max=20 parameter on the ProxyPass directive actually have meaning / is advisable? The documentation (http://httpd.apache.org/docs/2.1/mod/mod_proxy.html#proxypass) suggests that only one connection with Prefork MPM is standard.

slominskir
Offline
Joined: 2010-11-15
Points: 0

Thanks for the information.

It would be helpful to update the GlassFish Administration guide mod_jk section to document the information you've provided here (Apache proxy max threads should be at no more than GlassFish max-threads).

It seems the default max-threads for the default thread pool is rather low (5).

Currently I'm just using the default thread pool for mod_jk (now with an increased max-threads). Should mod_jk be using its own thread pool? What is the advantage of having separate thread pools?