Friday, June 15, 2007

Counting Sessions Is Not Enough

In a previous post I described a fundamental conceptual problem with load balancing, in particular as it applies to SBC. As I explained, load balancing is intended to provide optimal resource utilization, yet it is very difficult to provide a concrete, measurable definition of what 'optimal' means in this context. As a result, many administrators that actually test the functionality of the load balancing solution they utilize are content with simply verifying that sessions are evenly distributed between servers. For this reason Windows Server 2008 Terminal Services includes the Session Broker which provides exactly this type of distribution. Likewise, the default load evaluator in Citrix Presentation Server does essentially the same thing. However simple session distribution isn’t necessarily the right thing to do, and it certainly isn’t the only valid load distribution scheme as the following example demonstrates:

Consider a server farm comprised of identical servers, where each server is powerful enough to host 20 user sessions without any noticeable performance degradation. Now consider a load balancer that simply fills up servers to that capacity, one after another. That is it sends the first 20 users to the first server, the next 20 users to the second server and so on. An administrator testing solely for even session distribution will conclude that this load balancer is broken, because there would be up to 20 sessions on some servers and zero sessions on the others. Yet from the end-user perspective everything is working fine because each user is enjoying good performance.

Obviously the example above is simplistic, for example is doesn't specify what happens after 20 sessions have been assigned to all the servers. Certainly we don't use this method of load balancing in PowerTerm WebConnect. However, what it does exemplify is a load balancing scheme that contradicts conventional wisdom, yet can still be satisfactory. This example demonstrates why I consider even session distribution as a means, not an end. Moreover, in many cases it is not even a sufficient means, such as when some users require more resources than others. For this reason the default load balancing scheme employed by PowerTerm WebConnect does not rely solely on counting sessions. Instead the session count is just one of several criteria used to determine to which server a session will be assigned. I’ll explain PowerTerm WebConnect’s default load balancing scheme in detail in an upcoming post so stay tuned.

2 comments:

Anonymous said...

TS Session broker load balancing in WS08 distributes load evenly at any given point of time. ie., when there are 10 incoming connections (one after the other), and 2 terminal servers in the farm, each of the terminal servers get 5 connections each. the 11th connection goes to terminal server 1, the 12th connection goes to terminal server 2 and so on. The actual issue with this is: - even though the session distribution is even, this might not be excellent load balancing as the users might run different applications and load the CPU and memory of the terminal servers differently, which is not taken into account by session broker, but still extremely effective for most of the TS workload characteristics.

EricomGuy said...

Anon, you are correct, to an extent. TS Session Broker will usually divide the sessions evenly, but it also allows you to (manually) assign a weight value to each server. So if the first server has the default weight - 100 - and you assign 200 to the second, the second server will get double the sessions.

Also, TS Session Broker has logon throttling functionality. This can also affect session distribution when logons happen at a rapid pace, or if one server has slower logons.

I agree that in most simple scenarios TS Session Broker is good enough (and is a significant step forward from NLB). For more complex scenarios I think counting sessions is not enough, which is why I've written several posts about this subject.