The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: Load balancer

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 9 - Last Post: Jan 8, 2009 12:35 AM by: Pankaj Jairath
theqmaster

Posts: 3
Load balancer
Posted: Dec 31, 2008 3:25 PM
  Click to reply to this thread Reply

What are the setting for the load balancer on glassfish ?

Does the cpu, connection pool, memory availability play a role or is just a plain round robin ?

Thanks!
Q

Pankaj Jairath
Re: Load balancer
Posted: Jan 4, 2009 9:35 PM   in response to: theqmaster
  Click to reply to this thread Reply

Load Balancing policies are round-robin, weighted and user defined. One
can use the user-defined policy to build custom load balancing policy;
for ex: MIME type based. LB does not specifically provide distribution
based on CPU, memory availability. One could use weighted, in case of
m/c with differential processing capabilities. For ex: m/c1 with two
cpu's (with instance1) is more powerful than m/c2 (with instance2) then
you could assign instance1 a weight of 2*weight-instance2; where
weight-instance2 is the weight assigned to instance2.

regards
Pankaj

glassfish@javadesktop.org wrote:
> What are the setting for the load balancer on glassfish ?
>
> Does the cpu, connection pool, memory availability play a role or is just a plain round robin ?
>
> Thanks!
> Q
> [Message sent by forum member 'theqmaster' (theqmaster)]
>
> http://forums.java.net/jive/thread.jspa?messageID=323750
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


theqmaster

Posts: 3
Re: Load balancer
Posted: Jan 7, 2009 12:07 PM   in response to: Pankaj Jairath
  Click to reply to this thread Reply

So what is the purpose of a load balancer if cannot detect the load.

Am I misunderstanding the reason LB exists ? Is it only for application server availability recovery ?

I've seen cases in BEA when one server in the cluster because slower because the high processing volume yet the round-robin bases LB would deliver new requests to that very server making the recovery slower and sometime bringing the server down.

The weighed description makes sense in case one server is better, hardware-wise, then then other. But that is not typical for big business.

Jacob Kessler
Re: Load balancer
Posted: Jan 7, 2009 1:53 PM   in response to: theqmaster
  Click to reply to this thread Reply

With the caveat that I have no actual experience with the glassfish load
balancer:

It seems like what Pankaj is saying is that the default load balancers
that glassfish ships with are round-robin and weighted. Those will
likely be sufficient in most cases, especially in applications where the
installation isn't worth writing a custom one.

The user-defined policy could be as complicated as you wanted to to be,
and might well involve having the nodes report when they are under or
over-used to the LB. Such a setup would be very dependent on the
deployed apps and the cluster they were deployed on, so it makes sense
not to supply one by default. My impression is that with the
user-defined load balancer, you could build a system that detects load.
The definition of "load", though, isn't something that Glassfish can
figure out on its own.

glassfish@javadesktop.org wrote:
> So what is the purpose of a load balancer if cannot detect the load.
>
> Am I misunderstanding the reason LB exists ? Is it only for application server availability recovery ?
>
> I've seen cases in BEA when one server in the cluster because slower because the high processing volume yet the round-robin bases LB would deliver new requests to that very server making the recovery slower and sometime bringing the server down.
>
> The weighed description makes sense in case one server is better, hardware-wise, then then other. But that is not typical for big business.
> [Message sent by forum member 'theqmaster' (theqmaster)]
>
> http://forums.java.net/jive/thread.jspa?messageID=324618
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


theqmaster

Posts: 3
Re: Load balancer
Posted: Jan 7, 2009 2:30 PM   in response to: Jacob Kessler
  Click to reply to this thread Reply

Jacob I agree entirely. Glassfish is the dummy here...

Is there a place you guys can point out that I can read more about user-defined policy for LBers ?

Jacob Kessler
Re: Load balancer
Posted: Jan 7, 2009 3:35 PM   in response to: theqmaster
  Click to reply to this thread Reply

Unfortunately, I'm not very knowledgeable about the Glassfish load
balancer. However, it looks like a reasonable place to start would be at
http://today.java.net/pub/a/today/2008/01/15/dynamic-load-balancing-in-glassfish.html
, though I'll apologize in advance in case it is out of date.

glassfish@javadesktop.org wrote:
> Jacob I agree entirely. Glassfish is the dummy here...
>
> Is there a place you guys can point out that I can read more about user-defined policy for LBers ?
> [Message sent by forum member 'theqmaster' (theqmaster)]
>
> http://forums.java.net/jive/thread.jspa?messageID=324640
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


Phillip Ross
Re: Load balancer
Posted: Jan 7, 2009 4:01 PM   in response to: Jacob Kessler
  Click to reply to this thread Reply

If the details in this article regarding the dynamic load balancing are not in the glassfish documentation... they really should be!



----- Original Message ----
> From: Jacob Kessler <Jacob.Kessler@Sun.COM>
> To: users@glassfish.dev.java.net
> Sent: Wednesday, January 7, 2009 6:53:36 PM
> Subject: Re: Load balancer
>
> Unfortunately, I'm not very knowledgeable about the Glassfish load
> balancer. However, it looks like a reasonable place to start would be at
> http://today.java.net/pub/a/today/2008/01/15/dynamic-load-balancing-in-glassfish.html
>
> , though I'll apologize in advance in case it is out of date.
>
> glassfish@javadesktop.org wrote:
> > Jacob I agree entirely. Glassfish is the dummy here...
> >
> > Is there a place you guys can point out that I can read more about
> user-defined policy for LBers ?
> > [Message sent by forum member 'theqmaster' (theqmaster)]
> >
> > http://forums.java.net/jive/thread.jspa?messageID=324640
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> > For additional commands, e-mail: users-help@glassfish.dev.java.net
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


Phillip Ross
Re: Load balancer
Posted: Jan 7, 2009 4:05 PM   in response to: Phillip Ross
  Click to reply to this thread Reply

And while I'm on the topic of load balancers... are there are talks, discussions, plans, ideas about a lightweight software based load balancer for glassfish that exists in a more standalone fashion? One that does not require an IIS, Apache, or SJS web server installation? One that is very small and easy to install and configure... maybe even builing on top of an embedded gfv3 architecture?



----- Original Message ----
> From: Phillip Ross <phillip.ross@yahoo.com>
> To: users@glassfish.dev.java.net
> Sent: Wednesday, January 7, 2009 7:01:49 PM
> Subject: Re: Load balancer
>
> If the details in this article regarding the dynamic load balancing are not in
> the glassfish documentation... they really should be!
>
>
>
> ----- Original Message ----
> > From: Jacob Kessler
> > To: users@glassfish.dev.java.net
> > Sent: Wednesday, January 7, 2009 6:53:36 PM
> > Subject: Re: Load balancer
> >
> > Unfortunately, I'm not very knowledgeable about the Glassfish load
> > balancer. However, it looks like a reasonable place to start would be at
> >
> http://today.java.net/pub/a/today/2008/01/15/dynamic-load-balancing-in-glassfish.html
>
> >
> > , though I'll apologize in advance in case it is out of date.
> >
> > glassfish@javadesktop.org wrote:
> > > Jacob I agree entirely. Glassfish is the dummy here...
> > >
> > > Is there a place you guys can point out that I can read more about
> > user-defined policy for LBers ?
> > > [Message sent by forum member 'theqmaster' (theqmaster)]
> > >
> > > http://forums.java.net/jive/thread.jspa?messageID=324640
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> > > For additional commands, e-mail: users-help@glassfish.dev.java.net
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> > For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


Kshitiz Saxena
Re: Load balancer
Posted: Jan 7, 2009 10:35 PM   in response to: Phillip Ross
  Click to reply to this thread Reply

Hi,

Let me go step by step:

The purpose of load-balancer is to distribute load across instances for
higher overall throughput. In case a serving instance goes down,
fail-over the requests to other healthy instances thus providing
seamless user experience.

Load-balancer supports round-robin, weighted round-robin and
user-defined policy. In general, load-balancing does not base upon load
on back-end system. To take into account of slow system, we have active
health check mechanism. If enabled, even healthy instances will be
checked whether they respond to request in configured amount of time(Say
T). If an instance does not respond in time T, it will be marked
unhealthy. I believe instance not responding in time T, will be function
of load on system, which will be dependent on cpu/memory usage etc.
Though we do not take that directly into account, this can address it to
certain extent. Please refer to documentation available @
http://docs.sun.com/app/docs/doc/819-3679/abdhs?l=en&a=view(Check for
active-healthcheck-enabled)

In case you are looking for a solution without web-server, please refer
to converged load-balancer available is sailfin
<https://. It works in self-load-balancing
topology. Please refer to my blog for more details :
http://blogs.sun.com/kshitiz/entry/converged_load_balancer

Thanks,
Kshitiz



Phillip Ross wrote:
> And while I'm on the topic of load balancers... are there are talks, discussions, plans, ideas about a lightweight software based load balancer for glassfish that exists in a more standalone fashion? One that does not require an IIS, Apache, or SJS web server installation? One that is very small and easy to install and configure... maybe even builing on top of an embedded gfv3 architecture?
>
>
>
> ----- Original Message ----
>
>> From: Phillip Ross <phillip.ross@yahoo.com>
>> To: users@glassfish.dev.java.net
>> Sent: Wednesday, January 7, 2009 7:01:49 PM
>> Subject: Re: Load balancer
>>
>> If the details in this article regarding the dynamic load balancing are not in
>> the glassfish documentation... they really should be!
>>
>>
>>
>> ----- Original Message ----
>>
>>> From: Jacob Kessler
>>> To: users@glassfish.dev.java.net
>>> Sent: Wednesday, January 7, 2009 6:53:36 PM
>>> Subject: Re: Load balancer
>>>
>>> Unfortunately, I'm not very knowledgeable about the Glassfish load
>>> balancer. However, it looks like a reasonable place to start would be at
>>>
>>>
>> http://today.java.net/pub/a/today/2008/01/15/dynamic-load-balancing-in-glassfish.html
>>
>>
>>> , though I'll apologize in advance in case it is out of date.
>>>
>>> glassfish@javadesktop.org wrote:
>>>
>>>> Jacob I agree entirely. Glassfish is the dummy here...
>>>>
>>>> Is there a place you guys can point out that I can read more about
>>>>
>>> user-defined policy for LBers ?
>>>
>>>> [Message sent by forum member 'theqmaster' (theqmaster)]
>>>>
>>>> http://forums.java.net/jive/thread.jspa?messageID=324640
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


Pankaj Jairath
Re: Load balancer
Posted: Jan 8, 2009 12:35 AM   in response to: theqmaster
  Click to reply to this thread Reply

This is quite an extensive topic, I would address it like this -

1. Load Balancing is the mechanism towards achieving availability of
deployed services. There can various failure scenarios which would
result in a node/instance being not available to service the requests.
Here in Load Balancer would detect this and failover the load to another
healthy instance/node in the cluster deployment.

2. It also achieves the goal of scalability of deployments. As
enterprises grow, they face increased load and to be able to handle the
load it would require to add additional nodes into the cluster
deployment. Load Balancer helps achieving this as well in real time with
dynamic reconfig support. Usually before going live, cluster deployment
needs to be tuned (no. of nodes in the system that need to be
configured, heap size, resources, OS parameters at network level, etc)
to able to cater the expected load - for ex: peak traffic expected, this
is an extensive exercise so as to put in place a live deployment that is
capable of handling the load. With such kind of modeling being
undertaken before going live, contemporary load balancing policies like
round-robin serve the purpose.

3. Load Balancer has been designed to keep it a light weight component -
the percentage drop while using it in the request processing path ought
to be at minimal. It monitors the health of a node/instance from the eye
of "response-time" that shall be considered as healthy window towards
processing the requests. There are multiple factors which can cause this
window to expand in real-time - node/instance suffering low on memory,
contention for system resources etc. Load Balancer detects this change
in the window and would mark such an instance as unhealthy thereby
taking it out from active load balancing. Load Balancer would
periodically monitor the set of unhealthy instances and bring them back
into active load balancing when these come within the healthy window
time period. The point here is that though an instance can service
client request and is available; it is the time it takes to process the
request that is critical - one cannot have clients waiting beyond a
reasonable period, which effectively can actually cause increased load
from client with some of them retrying request which would simply get
queued up before the rejection starts at system level. Thus Load
Balancer focuses on the net outcome when an instance becomes unhealthy.

Towards this there are two mechanisms of health check by Load Balancer -
a. Passive health check
In this Load Balancer uses the request to piggy back the health check
semantics. In this case it uses the request-timeout configured at
web-module level. It would through an error page, which can be
customized error urls. For example - an error message mentioning that
user should retry after certain amount of time.

b. Active health check
In this Load Balancer can be configured to send a simple HTTP request to
an application deployed on the cluster. The application is known as the
health check application and user can choose to write it in a manner
that would suffice to notify the Load Balancer that instance is not
under the healthy window. By default this URL is "/" for out-of-box Load
Balancer deployment. Load Balancer associates three parameters to such
a custom application to identify the node/instance as being unhealthy
and these are :
- request-timeout
This is window within which a response should be received.
- response status code
500 or above raise error condition and signal Load Balancer to
remove the instance from active load balancing.
- retry
Mechanism to retry the health check request, ping request, before
confirming the failure/error scenario.

4. One can use self management feature of GlassFish while writing such a
health check application.

5. In conjunction with point 3. with the need for GlassFish to announce
that it can no longer accept new load; one would/should configure while
tuning the cluster deployment the http service connector parameters like
- no. of pipelined requests, no.of queued connections, etc. Please have
a look at "request-processing" and "keep-alive" element of http-service.
As part of the modeling exercise this helps the system from being
overloaded; also these can be adapted dynamically as well.

regards
Pankaj




glassfish@javadesktop.org wrote:
> So what is the purpose of a load balancer if cannot detect the load.
>
> Am I misunderstanding the reason LB exists ? Is it only for application server availability recovery ?
>
> I've seen cases in BEA when one server in the cluster because slower because the high processing volume yet the round-robin bases LB would deliver new requests to that very server making the recovery slower and sometime bringing the server down.
>
> The weighed description makes sense in case one server is better, hardware-wise, then then other. But that is not typical for big business.
> [Message sent by forum member 'theqmaster' (theqmaster)]
>
> http://forums.java.net/jive/thread.jspa?messageID=324618
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net





 XML java.net RSS