Home > Uncategorized > Configuring Grizzly for performance part II: Setting the proper values in domain.xml

Configuring Grizzly for performance part II: Setting the proper values in domain.xml

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:


Disable AS Quick Startup:


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="" 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 🙂

_uacct = “UA-3111670-1”;


Categories: Uncategorized
  1. June 29, 2012 at 2:58 pm

    Thank you sooo much for this information, you saved my week end 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: