users@glassfish.java.net

Re: glassfish 3 setting request-processing thread

From: <glassfish_at_javadesktop.org>
Date: Mon, 15 Mar 2010 02:27:54 PDT

Hi,

Since Glassfish v3 you can set this setting per HTTP listener.

You should take a look at this blog http://weblogs.java.net/blog/jfarcand/archive/2009/11/27/putting-glassfish-v3-production-essencial-surviving-guide

By Jean-Francois Arcand

Especially:

"Make sure you take a look at "what changed" since v2 and how you can properly configure Grizzly in v3. The one you should care are acceptors-thread

network-config>transports>transport>tcp#acceptor-threads
and the number of worker threads
network-config>thread-pools>http-threadpool
The recommended value for acceptors-thread should be the number of core/processor available on the machine you deploy on. I recommend you always run sanity performance test using the default value (1) and with the number of core just to make sure. Next is to decide the number of threads required per HTTP port. With GlassFish v2, the thread pool configuration was shared amongst all HTTP port, which was problematic, as some port/listener didn't needed to have that many threads as port 8080. We fixed that in v3 so you can configure the thread pool per listener. Now the ideal value for GlassFish v3 should always be between 20 and 500 maximum as Grizzly use an non blocking I/O strategy under the hood, and you don't need as many threads as if you were using a blocking I/O server like Tomcat. Here I can't recommend a specific number, it is always based on what your application is doing. For example, if you do a lot of database query, you may want to have a higher number of threads just in case the connection pool/jdbc locks on a database, and "waste" threads until they unlock. In GlassFish v2, we did see a lot of applications that were hanging because all the worker threads were locked by the connection-pool/jdbc. The good things in v3 is those "wasted" threads will eventually times out, something that wasn't available with v2. The default value is 5 minutes, and this is configurable
configs.config.server-config.thread-pools.thread-pool.http-thread-pool.idle-thread-timeout-seconds"

His guide has been very helpful for me on Tuning both Gf v2 and v3
[Message sent by forum member 'bvansomeren' (barry_at_bvansomeren.com)]

http://forums.java.net/jive/thread.jspa?messageID=391877