users@glassfish.java.net

Re: A pitfall in upgrading to GF v3 with JK listeners

From: Amy Roh <Amelia.Roh_at_Sun.COM>
Date: Tue, 16 Mar 2010 13:50:29 -0700

glassfish_at_javadesktop.org wrote:
> 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
> Port: 8009
> Address: 127.0.0.1
>
> 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=50 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.
> [Message sent by forum member 'pboro' (pauli_at_borodulin.fi)]

Sorry for the trouble.

The default max-thread-pool-size was reduced to 5 since it was decided
to be enough due to the NIO nature of the grizzly.

V3's default domain.xml also defines "thread-pool-1" with
max-thread-pool-size=200 as it was in v2.

       <thread-pools>
         <thread-pool name="http-thread-pool" />
         <thread-pool name="thread-pool-1" max-thread-pool-size="200" />
       </thread-pools>

You can create a jk-connector with "thread-pool-1" rather than using the
default http-thread-pool if you need to increase the max-thread-pool size.

create-network-listener .... --listenerport 8009 --threadpool
thread-pool-1 --jkenabled=true jk-connector

Sun GlassFish Enterprise Server v3 Reference Manual [1] mentions that
the default thread pool is http-thread-pool.

Amy

[1]
http://docs.sun.com/app/docs/doc/820-7701/create-network-listener-1?l=En&a=view



>
> http://forums.java.net/jive/thread.jspa?messageID=391178
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>