Discussion:
NLB - No Affinity Not Working
(too old to reply)
b***@gmail.com
2006-05-04 20:46:04 UTC
Permalink
Hi,
I have an NLB cluster set to no affinity. However I see that one
server in the cluster has anywhere from 60 to 80 connections while the
other has 0 and maybe 1. This doesn't seem quite right to me.
Shouldn't I have approx 30 to 40 per server? How can I fix this to
truly load balance the servers?

Thanks,
Bill
Mike Rosado [MSFT]
2006-05-04 21:40:46 UTC
Permalink
Hi Bill,

Please review the following Q&A from the NLB FAQ:
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/clustering/nlbfaq.mspx


Q.How Does Single Affinity Mode Differ From No Affinity Mode? Which One
Should I Use to Load Balance My Application?

A.In Single Affinity mode, NLB load balances traffic based only on the
Source IP Address of the incoming connection. So, Single Affinity mode
ensures that all TCP connections originating from the same client (IP
Address) are sent to the same host in the cluster. This will continue
indefinitely until a host is either added or removed from the cluster, at
which time the connections originating from that IP address may get mapped
to a different host in the cluster.

In No Affinity mode, NLB load balances traffic based on Source IP Address
and Source Port of the incoming connection request. Therefore, in No
Affinity mode, multiple connections from the same client may be handled by
different hosts in the cluster as long as these connections have different
source ports.
Which mode to use really depends on the application being load balanced. If
the application makes use of sessions which persist over multiple TCP
connections, NLB should be configured in Single Affinity mode because you
want to make sure that all TCP connections which are part of a single
session are mapped to the same host in the cluster.

On the other hand, No Affinity allows a better load distribution because it
does not require client connections be handled by specific servers. Thus for
applications that do not use sessions and for which it is acceptable for
multiple incoming connections originating from the same client to be handled
by different hosts in the cluster, No Affinity would be a better mode of
operation.


Q.How Does the NLB Load Balancing Algorithm Work?

A.NLB employs a fully distributed filtering algorithm to map incoming
clients to the cluster hosts. This algorithm enables cluster hosts to
independently and quickly make a load balancing decision for each incoming
packet. It is optimized to deliver statistically even load balance for a
large client population making numerous, relatively small requests, such as
those typically made to Web servers. When the client population is small
and/or the client connections produce widely varying loads on the server,
the load-balancing algorithm is less effective. However, the simplicity and
speed of NLBs algorithm allows it to deliver very high performance,
including both high throughput and low response time, in a wide range of
useful client/server applications. If No Affinity is set, NLB load balances
incoming client requests so as to direct a selected percentage of new
requests to each cluster host; the load percentage for each host is set in
the NLB Properties dialog for each port range to be load balanced. The
algorithm does not dynamically respond to changes in the load on each
cluster host (such as the CPU load or memory usage). However, the load
distribution is modified when the cluster membership changes, and load
percentages are renormalized accordingly.

When inspecting an arriving packet, all hosts simultaneously perform a
mapping to quickly determine which host should handle the packet. The
mapping uses a randomization function that calculates a host priority based
on their IP address, port, and other information. The corresponding host
forwards the packet up the network stack to TCP/IP, and the other cluster
hosts discard it. The mapping remains unchanged unless the membership of
cluster hosts changes, ensuring that a given clients IP address and port
will always map to the same cluster host. However, the particular cluster
host to which the clients IP address and port map cannot be predetermined
since the randomization function takes into account the current and past
clusters membership to minimize remappings.

In general, the quality of load balance is statistically determined by the
number of clients making requests. This behavior is analogous to dice throws
where the number of cluster hosts determines the number of sides of a die,
and the number of client requests corresponds to the number of throws. The
load distribution improves with the number of client requests just as the
fraction of throws of an N-sided die resulting in a given face approaches
1/N with an increasing number of throws. As a rule of thumb, with client
affinity set, there must be at least five times more clients than cluster
hosts to begin to observe even load balance.

The Network Load Balancing client affinity settings are implemented by
modifying the statistical mapping algorithms input data. When client
affinity is selected in the NLB Properties dialog, the clients port
information is not used as part of the mapping. Hence, all requests from the
same client always map to the same host within the cluster. Note that this
constraint has no timeout value and persists until there is a change in
cluster membership. When single affinity is selected, the mapping algorithm
uses the clients full IP address. However, when Class C affinity is
selected, the algorithm uses only the Class C portion (upper 24 bits) of the
clients IP address. This ensures that all clients within the same Class C
address space map to the same cluster host.
--
Thanks in advance,
________________________________
Mike Rosado | Microsoft Beta Support Engineer | Cluster Technologies
Hours: 8:00 AM - 5:00 PM Central (GMT-06:00)

====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/info/cpyright.htm


-----Original Message-----
Post by b***@gmail.com
Hi,
I have an NLB cluster set to no affinity. However I see that one
server in the cluster has anywhere from 60 to 80 connections while the
other has 0 and maybe 1. This doesn't seem quite right to me.
Shouldn't I have approx 30 to 40 per server? How can I fix this to
truly load balance the servers?
Thanks,
Bill
b***@gmail.com
2006-05-08 18:36:08 UTC
Permalink
Hi Mike,
Thanks for your response, but I had already read that and not sure how
that answers my question. I have no affinity, two hosts, and about 60
to 70 clients connected at any given time, yet all the traffic goes to
one host. According to that, running without affinity should be better
at balancing load evenly. Even running with affinity they say you need
about 5x the clients as hosts to see load balancing. We have 30x to
35x as many clients as hosts. Can you please explain a little as to
what you are suggesting?

Thanks,
Bill
Mike Rosado [MSFT]
2006-05-08 21:35:16 UTC
Permalink
I guess what I'm trying to say Bill, is that there are no parameters to
tweak so you can equally balance the load between nodes.
--
Regards,
________________________________
Mike Rosado | Microsoft Beta Support Engineer | Cluster Technologies
Hours: 8:00 AM - 5:00 PM Central (GMT-06:00)

====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/info/cpyright.htm


-----Original Message-----
Post by b***@gmail.com
Hi Mike,
Thanks for your response, but I had already read that and not sure how
that answers my question. I have no affinity, two hosts, and about 60
to 70 clients connected at any given time, yet all the traffic goes to
one host. According to that, running without affinity should be better
at balancing load evenly. Even running with affinity they say you need
about 5x the clients as hosts to see load balancing. We have 30x to
35x as many clients as hosts. Can you please explain a little as to
what you are suggesting?
Thanks,
Bill
zinck74
2006-05-09 22:37:44 UTC
Permalink
So how does it work then? I guess I don't understand the point of it.
How could it possibly think it should send every connection to one
host?

Thanks,
Bill
Mike Rosado [MSFT]
2006-05-10 19:17:06 UTC
Permalink
Please review the following Q&A from the NLB FAQ:
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/clustering/nlbfaq.mspx


Q.How Does the NLB Load Balancing Algorithm Work?

A.NLB employs a fully distributed filtering algorithm to map incoming
clients to the cluster hosts. This algorithm enables cluster hosts to
independently and quickly make a load balancing decision for each incoming
packet. It is optimized to deliver statistically even load balance for a
large client population making numerous, relatively small requests, such as
those typically made to Web servers. When the client population is small
and/or the client connections produce widely varying loads on the server,
the load-balancing algorithm is less effective. However, the simplicity and
speed of NLBs algorithm allows it to deliver very high performance,
including both high throughput and low response time, in a wide range of
useful client/server applications. If No Affinity is set, NLB load balances
incoming client requests so as to direct a selected percentage of new
requests to each cluster host; the load percentage for each host is set in
the NLB Properties dialog for each port range to be load balanced. The
algorithm does not dynamically respond to changes in the load on each
cluster host (such as the CPU load or memory usage). However, the load
distribution is modified when the cluster membership changes, and load
percentages are renormalized accordingly.

When inspecting an arriving packet, all hosts simultaneously perform a
mapping to quickly determine which host should handle the packet. The
mapping uses a randomization function that calculates a host priority based
on their IP address, port, and other information. The corresponding host
forwards the packet up the network stack to TCP/IP, and the other cluster
hosts discard it. The mapping remains unchanged unless the membership of
cluster hosts changes, ensuring that a given clients IP address and port
will always map to the same cluster host. However, the particular cluster
host to which the clients IP address and port map cannot be predetermined
since the randomization function takes into account the current and past
clusters membership to minimize remappings.

In general, the quality of load balance is statistically determined by the
number of clients making requests. This behavior is analogous to dice throws
where the number of cluster hosts determines the number of sides of a die,
and the number of client requests corresponds to the number of throws. The
load distribution improves with the number of client requests just as the
fraction of throws of an N-sided die resulting in a given face approaches
1/N with an increasing number of throws. As a rule of thumb, with client
affinity set, there must be at least five times more clients than cluster
hosts to begin to observe even load balance.

The Network Load Balancing client affinity settings are implemented by
modifying the statistical mapping algorithms input data. When client
affinity is selected in the NLB Properties dialog, the clients port
information is not used as part of the mapping. Hence, all requests from the
same client always map to the same host within the cluster. Note that this
constraint has no timeout value and persists until there is a change in
cluster membership. When single affinity is selected, the mapping algorithm
uses the clients full IP address. However, when Class C affinity is
selected, the algorithm uses only the Class C portion (upper 24 bits) of the
clients IP address. This ensures that all clients within the same Class C
address space map to the same cluster host.
--
Hope this helps,
________________________________
Mike Rosado | Microsoft Beta Support Engineer | Cluster Technologies
Hours: 8:00 AM - 5:00 PM Central (GMT-06:00)

====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/info/cpyright.htm


-----Original Message-----
Post by zinck74
So how does it work then? I guess I don't understand the point of it.
How could it possibly think it should send every connection to one
host?
Thanks,
Bill
zinck74
2006-05-10 20:13:23 UTC
Permalink
Ugh! I've read the FAQ, many times. What I'm looking for is a little
practical advice/information. This is partly because the FAQ doesn't
seem be applying in this situation.

As the FAQ states:
If No Affinity is set, NLB load balances
incoming client requests so as to direct a selected percentage of new
requests to each cluster host; the load percentage for each host is set
in
the NLB Properties dialog for each port range to be load balanced.

My load percentage is set to "Equal" yet it is not balancing equally.
Mark
2006-07-08 01:20:01 UTC
Permalink
You look at your IIS logs and see what the IP is? Maybe clients are proxied?
You try NLB STOP while it's running and see if everyone seemlessly moves
over? Basic but practical!
Post by zinck74
Ugh! I've read the FAQ, many times. What I'm looking for is a little
practical advice/information. This is partly because the FAQ doesn't
seem be applying in this situation.
If No Affinity is set, NLB load balances
incoming client requests so as to direct a selected percentage of new
requests to each cluster host; the load percentage for each host is set in
the NLB Properties dialog for each port range to be load balanced.
My load percentage is set to "Equal" yet it is not balancing equally.
zinck74
2006-07-19 17:33:05 UTC
Permalink
Hi Mark,
All users are internal to our network and there is no proxy used within
the network. Users are showing up with many different IPs and even
different subnets in the IIS log files. It's gone to a further extreme
at this point even. Having over 115 connections to one server and
literally 0 to another. And yes, when you take the one that is
receiving all the traffic offline all the traffic moves to the other.
So it's at least working to some point. But honestly, come on now, how
can anyone say this is working when something called "load balancer"
diverts all the load to one server? I would expect to see roughly the
same number of connections on each server. Heck, even a quarter would
be adequate.

Any other thoughts?

Thanks,
Bill

.
Post by Mark
You look at your IIS logs and see what the IP is? Maybe clients are proxied?
You try NLB STOP while it's running and see if everyone seemlessly moves
over? Basic but practical!
Post by zinck74
Ugh! I've read the FAQ, many times. What I'm looking for is a little
practical advice/information. This is partly because the FAQ doesn't
seem be applying in this situation.
If No Affinity is set, NLB load balances
incoming client requests so as to direct a selected percentage of new
requests to each cluster host; the load percentage for each host is set in
the NLB Properties dialog for each port range to be load balanced.
My load percentage is set to "Equal" yet it is not balancing equally.
Mark
2006-07-20 00:35:01 UTC
Permalink
Can you blame it on the switch/hub you're connected to? Try playing around
with both Unicast/Multicast, maybe dedicated NIC's? I've always seen even
load with no affinity. If you're using ISA Server all your troubles will be
gone in a few weeks when 2006 lauches can can use the new web site load
balancing built in ;-)

Loading...