users@glassfish.java.net

Re: Load Balancer Proxy by Mime-Type

From: Pankaj Jairath <Pankaj.Jairath_at_Sun.COM>
Date: Fri, 11 Apr 2008 16:36:39 +0530

Hello Tim,

You can achieve this by setting the load balancing policy as
"user-defined".

Basically, you would need to implement the /loadbalancer.h/ native
interface as the shared library. You can code the logic to determine the
content-type and accordingly decide to process /load balance the request.

For further details on user defined load balancing policy of HTTP Load
Balancer, do read through -

http://docs.sun.com/app/docs/doc/819-3679/gfykx?a=view

Take a look at sample implementation /loadbalancer.h/ - roundrobin.c :
implements the round robin mechanism.

Details on the interface methods :

*/* lb_policy_init/* would be called by the load balancer whenever it
starts up and has a list of active instances and also whenever this list
changes either with a healthy instance becoming unhealthy or
vice versa.

When a request arrives at loadbalancer, it first matches the request
with the configured context roots. If there is no match, control is
returned to the webserver as done at present.

The */lb_decision/* would be called for every request which requires a
selection of an instance. The lb_decision is not called for stuck
requests.The method returns the name of the selected listener. This
where you can add the logic on laod balancing based on MIME type.

regards
Pankaj

Kuntz, Tim wrote:
> I am attempting to migrate from WebLogic to Glassfish and am currently
> working on the load-balancing requirements.
>
> I have the need to proxy requests both by "path" or "context" AND by
> mime-type (file extension).
>
> This is required because some web applications contain both static and
> dynamic content and others contain only the dynamic content and require
> the web server to serve up images, etc...
>
> I have successfully configured load balancing between a Sun Web Server
> and Glassfish cluster using the sample "clusterjsp" app so I have met
> the proxy by path requirement, but I can't find any documentation
> regarding how to proxy by mime-type.
>
> Is proxying requests by mime-type even possible with the current Sun
> load balancer?
>
> Thanks in advance,
> Tim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>