views:

32

answers:

2

Thanks for taking time to read my questions.

I am having some basic doubts about the load balanced servers.

I assumes that, One applicatgion is hosted on the two servers, when one server is heavily loaded the load balancer is switching the responsibilites of handling the particular request to other server.

This is how I assumed about the load balancer.

  1. Which is managing and monitoring the load and do all the transfers of requests.

  2. How does the static variables are taken place for processing. For ex:- I have a variable called as 'totalNumberOfClick'. Which is being incremented whenever we hits the page.

  3. If a GET request is handled by a server, and its POST method also should be managed by that server.Right? For Ex:- A user is requesting a page for editing, the Asp.Net runtime will create a set of viewstate (which has controlID and its values) and is mainatained in the server and client side. When we hit the post button the server is validating the view state and allowing it to enter in to server and doing other processing.

    If the post is getting transferred to other server, how the Runtime allow it to do the processing.

A: 

If you are using the load balancing built into Windows, then there are several options for how the load is distributed. The servers keep in communication with each other and organise the load between themselves.

The most scalable option is to evenly balance the requests across all of the servers. This means that each request could end up being processed by a different server so a common practice is to use "sticky sessions". These are tied to the user's IP address, and make sure that all requests from the same user go to the same server.

There is no way to share static variables across multiple servers so you will need to store the value in a database or on another server.

If you find an out of process to host session state (such as stateserver or sql server) then you can process any request on any server. Viewstate allows the server to recreate most of the data needed that generated the page.

Matthew Steeples
A: 

I have some answers for you.

When it comes to web applications, load balancers need to provide what is calles Session Stickyness. That means that once a server is elected to serve a clients request all subsequent request will be directed to the same node as long as the session is active. Of course this is not neccessary if your web application does not rely on any state that has to be preserved (i.e. stateless, sessionless).

I think this can answer your third and maybe even your second question.

Your first question is on how load balancers work internally. Since I am not an expert in that I can only guess that the load balancer that each client is talking to measures ping response times to derive an estimated load amount on the server. Maybe more sophisticated techniques could be used.

Andreas