Skip to main content

Load Balancing

Why do you need to load balance ?

Here i will put forward the various options available for web load balancing.
Before we go into that , let us first examine why do we need load balancing after all.Consider you develop a website and is available to the public.If the application is served from a single webserver then there is a high chance that the machine will be overwhelmed if the usage of the application increases. This may result in users experiancing unusually high response times or in worse case the machine can come to a halt.So you need some mechanism to distribute the load across different machines,without the client having to swich address.


There are many widely used approaches. The most common ones are


  • DNS based load balancing
  • Software load balancing
  • Hardware load balancing





DNS based Load Balancing

Here the DNS server is configured in such a way that it returns different IP addresses for various requests to the DNS server for a particular domain name.
The DNS server may contain say 5 IPs for a particular domain name and on a round robin basis it can different IPs for different requests. The draaw back with this approach is it cannot do a weight based routing as it has no information on which server is heavily loaded. It can only do a round robin based load balancing. This would be sufficient for many websites.

Software Load Balancing

In this mechanism another webserver or some software plugins does the load balancing.
In the case of weblogic many plugins are available for various web servers. WLProxy plugin from weblogic is available for IIS, Apache etc. This plugin can load balance the web requests if the web application is deployed in a cluster in a weblogic server. The advantage with software load balancing is that it can do weigh based load balancing also. It can detect if any server in the cluster has go down . The plugin can remove that address from its algorithm. Also it can do server affiinity.

Hardware load balancing

In this mechanism a hardware like F5 Big IP load balancer can be used to do the load balancing.Hardware load balancers has mechanisms to load balance SSL requests also.
Also many such load balancers has the capability to compress a response. This can result in good response time from a low bandwidth environment.

Which load balancer to use is a decision to be taken based on the specific application requirements and projected usage.

Comments

Popular posts from this blog

Java - Too Many web frameworks

Hmm......... Java Web technology is exploding with many web frameworks promoted by the industry and many by opensource. Too many frameworks to choose from is a bad thing or good thing ?. Read on and judge yourselves. May be too much of anything is bad. Just look at the list below. JSF Spring MVC Tapestry Struts 2 ADF from Oracle Cocoon Maverick JBoss seam This is a never ending list. There are many more. Ofcourse not all are mainstream nowadays. Look at Microsoft stack , you mainly have ASP .NET and that's it. It has grown well.You need to learn only that and you focus all your skills in that web framework.It has accumulated many components and matured into a very robust RAD web application framework. The problem with the Java stream is you work on a particular web framework for sometime and all of a sudden you have to work in another web framework for another project.Hence the experiance one gains by working in a particular framework for long time, gets lost. This definitly lowers...

Using Database login Module in JBoss

This post is a detailed description on how to use the database login module in JBoss with a J2EE Application. Scenario There is a EJB and we want to restrict the access to this ejb's method to an authenticated user having a particular role. The EJB is accessed from a standalone Java Client using Remote Lookup. Implementation The EJB is HelloSSB and the roles allowed are admin and user. First step is to write the EJB The source code is given below. This is a stateless session bean. package com.prem.ejb; import javax.annotation.PreDestroy; import javax.annotation.Resource; import javax.annotation.security.RolesAllowed; import javax.ejb.SessionContext; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.jboss.annotation.security.SecurityDomain; @Stateless @SecurityDomain ("helloworld") public class HelloSSB implements HellioIntf{ @PersistenceContext(unitName = "EntApp") EntityManager em; @Reso...