users@glassfish.java.net

Re: grizzly error

From: <glassfish_at_javadesktop.org>
Date: Wed, 27 Aug 2008 21:13:22 PDT

First, thanks for helping out with this.

> > The reason for switching in the first place: The
> max-connections-reached: 4096 problem.
>
> You can increase that value by editing domain.xml:
>
> <connection-pool ... queue-size-in-bytes="4096"/>
>
> What was the problem you were facing? Sorry for
> asking again...
>


Won't increasing the queue just delay the inevitable?

The original setup was the queue size was 4096 and keep-alive is 250. This is how I saw it: With these settings each connection is kept alive to process 250 requests. But something was causing requests to take too long to finish. So each connection needs to be open for an unusually long period of time to process 250 of them and therefore more and more of them are opened until, over time, the connection pool limit is reached. So, I decided that if I setup the server to close/release the connection immediately after each request, the life span of the connection will be shortened and so chances of reaching the 4096 limit is drastically reduced. This was my reasoning. So, I changed the keep-alive to 1. Now, I wasn't sure if changing the the settings would mess things up for use with Grizzly, so, I switched to coyote with 500 request processing threads.


>
> I used coyote wit these settings: keep alive
> max-connections = 1, and
> imeout = 30 seconds. I also set request processing
> threads to 500. The
> 'real' reason for the connections is most likely in
> the application -
> maybe some JDBC connections weren't being closed or
> whatever.. I
> couldn't see the code in the very limited time I was
> allowed..
>
> Hum...but performance wise, it means the client will
> connect to the
> server, execute a single request and then the server
> will close the
> connection. Performance wise the network latency will
> not be good
> because browser will always have to open a connection
> to the server. It
> probably works, but I suspect you can improve the
> performance by not
> setting the max-connections to 1.
>
> A+
>
Yes. I agree. It's probably not the most performant, but my top priority was to ensure that the site is available. As far the user experience, I didn't find it bad at all. Also it is a moderate traffic site so I thought it won't be a major problem. Is that a reasonable assumption?

Please advise if there is a better configuration. Also, please correct me if my understanding of the use of various configuration parameters is wrong. Thanks.
[Message sent by forum member 'chilak' (chilak)]

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