users@glassfish.java.net

Re: About HTTP Listener configuration

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 16 Nov 2009 15:23:44 +0100

Salut,

désolé le délais

Bruno Bonfils wrote:
> Hello,
>
> I run glassfish for some website which have a lot of requests. I
> actually use a glassfish (on T2000) in cluster mode in order to have one
> JVM per application, there is no sessions synchronization. Each
> application (8 per T2000) is running on its own standalone instance. All
> of theses are managed by a simple DAS (still one per server).
>
> For sure, each instance use differents ports, have all of them have at
> least one extra virtual servers, with a default web module.
>
> I'm wondering about the good way to configure http listener, indeed,
> these last few days, some trouble occured on all instances, eg. the HTTP
> listeners was able to accepte a connection, but unable to answer
> to a simple GET request (GET / HTTP1.0).

Can you grab a jstack <PID>? I suspect all the threads are blocked on a
lock. Which version of GF are you using?


>
> So, I would like to understand good the differents layers of the HTTP
> stack. Actually, it seems to be difficult to have an overview about all
> components.
>
> According [http://docs.sun.com/app/docs/doc/820-4335/ablta?a=view], I
> understand the following stack:
>
> Client
> | |
> V V
> [ Acceptor Thread ] [ Acceptor Thread ]
> | |
> ---------- Connection Queue -----------
> | | | | |
> V V V V V
> [---- Sessions thread -----]
>
> By default, there is one acceptor thread by http-listener (in my case, 8
> instances, "cost" 8 + 1 threads).

This is AS 7 old documentation that should have been deleted awhile ago.
The HTTP layer in GlassFish is powered by Grizzly

   * http://grizzly.dev.java.net

and work like:

> [ Selector Thread ]
> |
> [ Acceptor Thread ] [ Acceptor Thread ]
> | |
> ---------- Connection Queue -----------
> | | | | |
> V V V V V
> [---- Worker thread -----]

The SelectorThread accept (OP_ACCEPT) the connection and round robin the
read (OP_READ) operations. Once a read or write I/O operation is ready,
the AcceptorThread will put the events is a queue, and a Worker Thread
will pick it up for processing the request.

Usually you should set the acceptor-threads number based on the core
available on the machine. The number of worker threads is configurable
using the domain.xml's request-processing thread-count element. The
default is 5, I suspect you might need to increase that value.

A+

-- Jeanfrancois







>