views:

94

answers:

2

The questions I have regarding load balancing are:

  1. Why exactly would you want to load balance web servers instead of upgrading to a new server?
  2. Is it common practice to have a load balanced setup whether it's for web servers or sql servers?
  3. Are there any disadvantages to load balancing?
  4. How is user information maintained across both servers. If information during the session were stored locally on one server, how would the other servers access it?

Or if you know of any good reference materials that answer these questions, that would be good too.

+1  A: 
  1. There are times, places, that you have more load than what you can handle with a single server. Also, load balancing gives you failover protection etc. If you have two servers, both would have to go down before you sites stopped responding etc. There are a number of other reasons as well.
  2. Yes, load balancing is a very common practice, you will see it on the web server, and on the database side you will typically see SQL Server Clustering/MIrroring or other setups to get redundancy and more processing power. However, you have to be in a case where you either need the additional power, or need the redundancy.
  3. Load balancing introduces issues, and there are things that you have to be aware of. You have more complex scenarios for management, but in the end, load balancing is the only way to scale with regards to expanding past single hardware capability and in a lot of cases true automatic redundancy.
  4. For this I am going to assume that you are talking about ASP.NET, this is one the "tricky" points I was mentioning in an earlier point. With ASP.NET you can change session state from InProc (the default) to a SQL Server state service, OR you could use Sticky Sessions on your load balancer OR you could simply avoid/not use session within your application OR you could use a third party state management service.
Mitchel Sellers
Valid answers. In your opinion would having 2 separate web servers (not load balanced) maintained for production be better, not as good, or equal to having a load balanced setup?
mjw06d
It isn't an apples to apples comparison. Without load balancing how to do you get people to each server? What about failover? What about peak load?
Mitchel Sellers
+1  A: 
  1. Sometime you have a very powerful server but it fails to meet your performance requirements. You want it to work 4 times quicker... An option could be increase CPU speed 4 time, HDD speed 4 times, etc... 4 time.. That could costs 4*4=16 times more expensive. An option could be buy additional 4 server (to have totally 5, they would increase overall performance in 4.1-4.6 times). And also, higher availability - is a good benefit.

  2. I wouldn't say it is a very common practice. it is not really too often you need that. Usually "it is a little bit expensive toy" :). And for SQL side I would suggest to use SQL Cluster and not an Load Balancing.

  3. There are I would say a lot of thing you need to keep on mind when implementing load balancing. Starting from session storage, single cache storage,... you will go into more complicated business process: check if "user" don't update information changed in the same time by another user, etc...

  4. Similarly to any kind of data you need to have a unique source of data. For sessions you need to have a "session provider" that for each server in your "farm" will decode "session id" and provide system with a session data. As Mitchel already said ASP.NET provides out-of-the-box solution for that.

References, I would start reading from something talking about writing scalable applications.

Few general references: http://loadbalancing.servers.co.uk/benefits http://en.wikipedia.org/wiki/Load_balancing_(computing) http://refcardz.dzone.com/refcardz/scalability

From (.NET) developer perspective a good reading would be: "Improving .NET Application Performance and Scalability", Microsoft, Pattern&Practice.

Budda