Forum Discussion

gc_33734's avatar
gc_33734
Icon for Nimbostratus rankNimbostratus
Jan 24, 2008

Ratio load balancing syntax

I am not so sure this is an "advanced" question, but I was unable to find this answered specifically enough anywhere else.

 

 

I am using an f5

 

version: BIG-IP 9.4.3 Build 1.4 Final

 

 

I am in a situation where I need to use the console/command line interface to configure my load balancer. I have a user that wants a pool set up with 2 devices, load balanced with a weighted ratio of 75%-25%. I need to know the syntax for creating a pool with 2 members, one which will receive 75% of incoming connections, with the other member receiving 25%. Here is what I used to configure the BIGIP the way it is right now:

 

 

node 10.10.145.10 {

 

ratio 75

 

}

 

node 10.10.145.11 {

 

ratio 25

 

}

 

 

pool TestPool_10049 {

 

lb method member ratio

 

member 10.10.145.10:10049 ratio 75

 

member 10.10.145.11:10049 ratio 25

 

}

 

 

virtual TestPool_10049 {

 

destination 10.193.64.222:10049

 

pool TestPool_10049

 

}

 

 

 

If I am in the console/command line interface and I do a "show" on this pool I get:

 

 

 

 

POOL TestPool_10049 LB METHOD member ratio MIN/CUR ACTIVE MEMBERS: 0/0

 

| conns (cur, max, limit, tot) = (0, 2, 0, 10)

 

| (pkts,bits) in = (55, 28320), out = (50, 29040)

 

+-> POOL MEMBER TestPool_10049/10.10.145.10:10049 ACTIVE,UNCHECKED SESSIONS ENABLED

 

| | priority 1 ratio 75 dynamic ratio 1

 

| | conns (cur, max, limit, tot) = (0, 1, 0, 5)

 

| | (pkts,bits) in = (28, 14416), out = (25, 14520)

 

| | requests (total) = 5

 

+-> POOL MEMBER TestPool_10049/10.10.145.11:10049 ACTIVE,UNCHECKED SESSIONS ENABLED

 

| priority 1 ratio 25 dynamic ratio 1

 

| conns (cur, max, limit, tot) = (0, 1, 0, 5)

 

| (pkts,bits) in = (27, 13904), out = (25, 14520)

 

| requests (total) = 5

 

 

 

 

So I must be doing something wrong, since the connections are being sent 50/50 to each member of the pool. Please help me out, and remember that I only have the console/command line interface right now.

 

 

Thanks

9 Replies

  • Ratio works by distributing the connections round-robin to the pool members until the configured level is exceeded. In your case, you won't meet your desired goal of 75/25 until 100 connections. The ratio is a representation of connections, not percentage, so I would suggest changing your ratio from 75/25 to 3/1.
  • Hey thank you very much, it is working correctly now. I set the ratio to 3:1 for both the members of the pool, and the nodes. Is it required that I set both of these for it to work? Either way, I appreciate the fast help - thank you very much!

     

     

    node 10.10.145.10 {

     

    ratio 3

     

    }

     

     

    node 10.10.145.11 {

     

    }

     

     

    pool TestPool_10049 {

     

    lb method member ratio

     

    member 10.10.145.10:10049 ratio 3

     

    member 10.10.145.11:10049

     

    }

     

     

     

    So do I have to set both the "node" ratio and the "member" ratio? Just curious, the pool is functioning as desired right now.
  • That depends on the algorithm you selected, ratio(node) or ratio(member)? Typically, if the node (read, IP address) only has one service, I use member. But if I have several services running on each node, then I will use node load balancing. That way, regardless of what's happening within an applications distribution, the physical servers aren't out of balance.

     

     

    A very notable exception to this setup would be batch applications. Anything less than iControl integration with batch apps is a very slippery slope.
  • I'm attempting to run the same setup but on a larger scale. I want to roll out a new application to a select % of people slowly ramping up the percentages. I have four boxes of version 1.0 and two boxes version 2. In order to setup a 5% to version 2 boxes I'm thinking

     

    v1 ratio 100

     

    v1 ratio 100

     

    v1 ratio 100

     

    v1 ratio 100

     

    v2 ratio 2

     

    v2 ratio 2

     

    The reason I came up with 2 is that I found the total of my main load server (400) then found 5% of that(4). The distributed that 5%(4) across the two boxes with a ratio of (2)

     

    ie sum(v1)*.05/count(v2boxes). The logic seems sound, if I'm on the right track.

     

     

    The thing that concerns me is when I want to get up to 50% it ends up all being 100. This doesn't seem right to be because that would evenly distribute across all boxes. Where I want 50% load split across v1 and 50% across v2.

     

    So my guess would be (but breaks my formula)

     

    v1 ratio 100

     

    v1 ratio 100

     

    v1 ratio 100

     

    v1 ratio 100

     

    v2 ratio 200

     

    v2 ratio 200

     

     

    I speculate that I shouldn't be dividing up the total across boxes, but using that same total for each box (if that makes sense)

     

     

    Thanks for any advise or point me to some documentation. I have 8 pools with different server distributions of v1/v2 servers to apply this too.

     

     

    EDIT: As a follow up, i'm going to be using a 45day cookie persistance to maintain "once on a version stay on a version"
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Not sure about your logic there for working out 5% of 400... The result should be closer to 22 (Once you added in the 2x 20's to get 440 for the total, 5% of that is 22), just as a quick does it feel right kind of check...

     

     

    As you surmise about the 50% ration, to get 50% you'd need the total of all the V1's to equal the total of all the V2's. And your guess is correct 4x100 = 2x 200)... And the reason it breaks your formula, is because your formula is wrong...

     

     

    H
  • ok, so another way to approach it would be start with a grand total, lets say 100. Then divide that up to the appropriate percentages.

     

    scenario:

     

    - define pool ratio total of 100

     

    - six servers in pool

     

    - divide the total pool ratio among the servers into two groups

     

    - 4x24 and 2x2 = 100 (96/4)

     

    - 4x12 and 2x26 = 100 (48/52) almost 50/50

     

    - 4x13 and 2x26 = 104 (50/50) goes over but is going to be evenly distributed

     

    - 4x1 and 2x2 = 8 (50/50) this would do the same as previous just in fewer requests

     

     

    Would it be safe to say:

     

    Members of the same weight are LB Round-Robin once the ratio weight determines which member group is going to get the request.

     

     

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    I didn't think that was the way the algorithm went... (i.e. two steps). But then the actual implementation is going to be secret anyway...

     

     

    Disclaimer: Most of my ratio work has been with dynamic ratios...

     

     

     

    H
  • I think it should be round robin between members of the same ratio. You could test this by using ratio load balancing with each pool member set to a ratio of 1. Note that this isn't a recommended config for doing ratio as there is more overhead with ratio (even with even ratios) than using round robin.

     

     

    Aaron
  • Thank you all for your help. I'm trying to roll out this next version and being able to do it in a % ramp up process to be able to tune and tweak. I figured my options were two pools or ratio weights.

     

     

    I was able verify the appropriate distribution between two members with a 1000 curl calls. But when it came to weight distributing within a pool with 6 members the exact implementation of the ratios got me. The part that was counter intuitive was setting the weight of the boxes that I want more traffic to to a lower weight (because there are more boxes). From Hamish's comment.

     

     

    I'll keep tweeking and testing. Thanks again.