03-27-2011 08:35 PM
Hi all,
I was looking at the following document on Cisco:
And i have a query as to how this load balancing algorithm will work.
content LOCAL-C
VIP address 192.168.3.6
protocol tcp
port 81
url "//site-c.mycompany.com/*"
add service C-S1
add service C-S2
add service C-S3
add service C-S4
add dns site-c.mycompany.com
dnsbalance preferlocal
balance leastconn
advanced-balance sticky-srcip
active
If the first request from client A comes in and all sessions from client A are load-balanced to service C-S1(because of advanced-balance sticky-srip), does the "least connection" algorithm kick in and only selects C-S2,C-S3 and C-S4 for the next request that hits the VIP?
Also, how is the advanced-balance sticky-srcip determined? Does it use a /32 or a /24 subnet when evaluating the source IP? Or is there a way we can specify this?
Thanks in advance!!
Solved! Go to Solution.
03-27-2011 10:11 PM
Sticky feature works before the determination of balance algorithm such as least conn.
If the entry is listed on sticky table, CSS sends packet with this table.
If the request is not listed on the entry, CSS determins the destination with balance algorithm.
So, if client A accesses to the vip and C-S1 is selected, all request from client A will be
forwarded to C-S1. When the entry is purged from sticky table by sticky timeout, next
request from client A will balance with least conn algorithm.
Other client request (not listed on sticky table) will be selected least conn algorithm.
If access from client is only client A as below.
Next request from non-client A will be destined to C-S2, C-S3 or C-S4.
CSS11503# show service summary
Service Name State Conn Weight Avg State
Load Transitions
C-S1 Alive 10 1 2 0
C-S2 Alive 0 1 2 0
C-S3 Alive 0 1 2 0
C-S4 Alive 0 1 2 0
If there are many access from some clients as below.
Next request from non-client A( and the entry is not listed on sticky
table) will be destined to C-S1 since C-S1 is least Conn Load.
CSS11503# show service summary
Service Name State Conn Weight Avg State
Load Transitions
C-S1 Alive 10 1 2 0
C-S2 Alive 20 1 2 0
C-S3 Alive 20 1 2 0
C-S4 Alive 20 1 2 0
sticky-srcip is use /32 mask by default.
You can change the mask with sticky-mask config in content rule as below.
CSS11503-A(config-owner-content[test-test])# sticky-mask
Please refer to the following URL regarding sticky mask feature.
Regards,
Yuji
03-27-2011 10:11 PM
Sticky feature works before the determination of balance algorithm such as least conn.
If the entry is listed on sticky table, CSS sends packet with this table.
If the request is not listed on the entry, CSS determins the destination with balance algorithm.
So, if client A accesses to the vip and C-S1 is selected, all request from client A will be
forwarded to C-S1. When the entry is purged from sticky table by sticky timeout, next
request from client A will balance with least conn algorithm.
Other client request (not listed on sticky table) will be selected least conn algorithm.
If access from client is only client A as below.
Next request from non-client A will be destined to C-S2, C-S3 or C-S4.
CSS11503# show service summary
Service Name State Conn Weight Avg State
Load Transitions
C-S1 Alive 10 1 2 0
C-S2 Alive 0 1 2 0
C-S3 Alive 0 1 2 0
C-S4 Alive 0 1 2 0
If there are many access from some clients as below.
Next request from non-client A( and the entry is not listed on sticky
table) will be destined to C-S1 since C-S1 is least Conn Load.
CSS11503# show service summary
Service Name State Conn Weight Avg State
Load Transitions
C-S1 Alive 10 1 2 0
C-S2 Alive 20 1 2 0
C-S3 Alive 20 1 2 0
C-S4 Alive 20 1 2 0
sticky-srcip is use /32 mask by default.
You can change the mask with sticky-mask config in content rule as below.
CSS11503-A(config-owner-content[test-test])# sticky-mask
Please refer to the following URL regarding sticky mask feature.
Regards,
Yuji
03-28-2011 12:24 AM
Thank you very much Yuji!! Definitely helped cleared my doubts!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide