Configuring Grizzly for performance part II: Setting the proper values in domain.xml
Posted by jfarcand on March 12, 2007 at 11:04 AM | Comments (6)
This time I will describe how to properly configure Grizzly in GlassFish. The out-of-the-box values are really not appropriate when GlassFish is used in production and can gives extremely bad results. Here is a couple of recommendations to make in domain.xml: First, make sure the -server VM is used instead of client: <jvm-options>-server</jvm-options>
Disable AS Quick Startup: <jvm-options>-Dcom.sun.enterprise.server.ss.ASQuickStartup=false</jvm-options>
Increase the number of worker threads: <request-processing header-buffer-length-in-bytes="8192" initial-thread-count="10"
request-timeout-in-seconds="30" thread-count="130" thread-increment="10"/>
Increase the worker thread queue: <connection-pool max-pending-count="-1" queue-size-in-bytes="-1"
receive-buffer-size-in-bytes="4096" send-buffer-size-in-bytes="8192"/>/code>
Here -1 will configure the queue to indefinitely accept connection. You might want to increase the default value instead. Enable the http file cache: <http-file-cache globally-enabled="true" file-caching-enabled="true" ... >
Make sure the acceptor-threads value is large enough: <http-listener id="http-listener-1" address="0.0.0.0" port="8080" acceptor-threads="2" ...
I usually match the value based on how many CPU are available. If you aren't planning to use WSIT, then turn off port unification by removing all occurrence of proxiedProtocols: <property name="proxiedProtocols" value="ws/tcp"/> Those modifications combined with part I will always make a difference :-)
technorati: grizzly performance glassfish
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
The 2nd one is: Disable AS Quick Startup and not AsyncStartup. Right ?
Posted by: claudio on March 12, 2007 at 01:11 PM
-
Yes. I've fixed the typo.
Posted by: jfarcand on March 16, 2007 at 11:03 AM
-
Dear Jean,
I would have a question, we are using glassfish, I used default configuration.
My question is should I configure server with profile other than developer in production? Will be there your advices included?
Other question is,
acceptor-threads="2",should be the same as number of procesors, so if I have only 1 procesor, it should be 1?
Thanks a lot
tomas zeman
tom@cotopia.com
Posted by: ertra on July 11, 2007 at 04:38 PM
-
Hi Tomas, for production, you still have to tune some values independently of the profile used. For the acceptor-threads, yes the fastest is to set it to 1. If you have more question, just post it on users@glassfish.dev.java.net to get a fastest response :-). Thanks!
Posted by: jfarcand on July 12, 2007 at 07:19 AM
-
Hi Jean-Francois,
what is your recommendation for the GF 2.0 Thread Pool?
Default is:
thread-pool idle-thread-timeout-in-seconds="120" max-thread-pool-size="200" min-thread-pool-size="0" num-work-queues="1" thread-pool-id="thread-pool-1"/
Thanks, Thorleif
Posted by: thorleif on October 01, 2007 at 02:24 AM
-
Hi, it really depends on your web traffic. BTW the above config is not for Grizzly, but for the IIOP/ORB/EJB. For Grizzly, look at the request-processing element. Thanks!
Posted by: jfarcand on October 02, 2007 at 07:42 AM
|