users@glassfish.java.net

Re: Application using HTTPS hang periodically

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 22 Feb 2008 09:06:54 -0500

glassfish_at_javadesktop.org wrote:
>> Salut,
>
>> Ya now I remember :-) Increase the acceptor-threads
>> from 5 to 100 :-)
>
> I have increased value of acceptor-threads as you said.
> While my application is working without any problems!!! :)))
> The performance have greatly increased. All images are loading very quickly.
> If problems will appear again I shall let you know :)
>
> Merci beaucoup! :)

De rien :-)

>
> But I don't understand why application works normally with HTTP, though there acceptor-threads="5" too?

Because http uses non blocking socket (NIO), and https use blocking.
With blocking, it means you need one thread per connection. If you open
5 connections, all the thread will be locked to executes browser request
on that connection. For a single connection, grizzly allow 250 requests
on that connection by default, and then close the connection (to gives a
chance to other). All Java web server works like that. So in you case,
if the browser does 5 requests, all threads will be "reserved" for 250
requests (or closed after 30 seconds of inactivity). With SSL, you have
much more that 5 requests, hence you images has to wait for either
grizzly closing the connection, or the browser to close it on its side.

With non blocking, you use a thread per request approach. A brower open
a connection, do a request, and then grizzly pool the connection and
execute another request. So with 5 threads, you can serve thousand of
requests without any delay (the 250 requests or 30 second idle still
apply) and you no longer need to reserve a thread every time a
connection is made to grizzly.

A+

-- Jeanfrancois

> [Message sent by forum member 'mikamj' (mikamj)]
>
> http://forums.java.net/jive/thread.jspa?messageID=260438
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>