users@grizzly.java.net

Re: Fairness of request processing in Glassfish

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Wed, 21 Nov 2007 10:17:55 -0500

Salut,

Jesper Söderlund wrote:
> I wonder if somebody could enlighten me with regards to the fairness of
> processing requests in Glassfish / Grizzly under load.

By default, same fairness for every requests are applied, meaning the
first requests that comes in is always the first executed (something
Tomcat doesn't do). This is quite important and one of the reason why we
have good score with specJ2004: all requests have the same chance to be
executed. This is the SEDA part of Grizzly that allow use to do that :-)

>
> Is there some some guarantee that one heavily loaded application will
> not hog all the resources from another using the same grizzly instance?

By default, if an application takes more CPU/resources than the other,
Grizzly doesn't have a mechanism to isolate the application by default.
I said by default because Grizzly have a extension (with both 1.0 and
1.5) that allow resource consumptions management [1]. This is something
you should take alook.

>
> Is the only way to "partion" the resources to create separate HTTP
> listeners?

No, see [2] for a good example.

>
> Will these threads configured for the HTTP-listener run through the
> servlet container and down into the EJB-container?

Yes.

>
> It would be great to be able to specify a weight for an application in
> the deployment descriptor and have the request processing scheduled
> accordingly.

Look at [1][2] :-) This is exactly what you need. 4homemedia.com
combined [2] with Grizzly Comet for their application and they told me
their performance has improved by isolating applications.

Thanks!

-- Jeanfrancois

[1]
http://weblogs.java.net/blog/jfarcand/archive/2006/04/resource_consum.html
[2]
http://weblogs.java.net/blog/jfarcand/archive/2007/06/improving_ajax_1.html

>
> /Jesper
>