Forum Discussion

Larry_G_54476's avatar
Larry_G_54476
Icon for Nimbostratus rankNimbostratus
Nov 29, 2011

F5 load balancing SMTP to 2 groups of servers

I have an F5 Load Balancers on the internal network.

 

 

I want to create a global VIP that directs SMTP traffic to 4 SMTP servers in group A.

 

 

I want the F5 to perform an SMTP health check on the 4 SMTP servers in group A.

 

 

If all 4 SMTP servers in group A fail the health check, I want the F5 to direct traffic to a second group of 4 SMTP servers in group B.

 

 

the F5 will continue to load balance to the group B servers until the group A SMTP servers are back up and respnding to the F5 Heath Check.

 

 

Can I configure the F5 to do this?

 

 

Thanks

 

Larry

4 Replies

  • can you try something like this? this is for http.

    [root@ve1023:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo1
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
    }
    [root@ve1023:Active] config  b pool foo1 list
    pool foo1 {
       monitor all http
       members 200.200.200.101:80 {}
    }
    [root@ve1023:Active] config  b pool foo2 list
    pool foo2 {
       monitor all http
       members 200.200.200.102:80 {}
    }
    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when CLIENT_ACCEPTED {
            if {[active_members [LB::server pool]] < 1} {
                    pool foo2
            }
    }
    }
    
    
  • Hi Larry G,

     

     

    If you go with the scenario that you have given you could suffer some adverse affects (depending on your traffic load and your server abilities).

     

     

    If you have four servers in each group.

     

    1 fails - traffic is redistributed to the remaining 3.

     

    2 fail - traffic is redistributed to the remaining 2.

     

    3 fail - traffic traffic goes the the remaining server and possibly overload the server and/or cause the responsiveness to degrade (again, depending on your traffic load).

     

     

    I would suggest putting all eight servers in a single pool and using Priority Activation Groups with a set of requirements that can be easily adjusted to fit your needs.

     

     

    Example:

     

    Server 1 - Group 2

     

    Server 2 - Group 2

     

    Server 3 - Group 2

     

    Server 4 - Group 2

     

    Server 5 - Group 1

     

    Server 6 - Group 1

     

    Server 7 - Group 1

     

    Server 8 - Group 1

     

     

    NOTE: Group Number of the highest number is active, so set your "Primary" Servers in the highest group number.

     

     

    Set Priority Activation Groups to less than 4. This will keep 4 servers active at all times.

     

     

    If a server in Group 2 (Active Server Set) fails, a single server from Group 1 would be made active to keep the load distribution equal (no traffic spikes or performance degradation).

     

    If two servers in Group 2 fail, two servers are activated in Group 1 and so on. When the servers in Group 2 are recovered, the traffic going to the server(s) in Group 1 will "finish up" the connections that they have and all new traffic would go back to normal. All automagically.

     

     

    Just a idea to try. Hope this helps.
  • hi Michael, good point. ­čÖé

    by the way, just curious when a number of active pool member in priority group 2 is less than 4, will priority group 1 bring only some of its pool member (not all the member)?

    this is my test. could you please advise if i missed anything?

    [root@ve1023:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve1023:Active] config  b pool foo list
    pool foo {
       min active members 2
       monitor all http
       members {
          200.200.200.101:80 {
             priority 2
          }
          200.200.200.102:80 {
             priority 2
          }
          200.200.200.111:80 {
             priority 1
          }
          200.200.200.112:80 {
             priority 1
          }
       }
    }
    [root@ve1023:Active] config  b pool foo|grep -i pool\ member
    +-> POOL MEMBER foo/200.200.200.101:80   active,up
    +-> POOL MEMBER foo/200.200.200.102:80   active,up
    +-> POOL MEMBER foo/200.200.200.111:80   active,up
    +-> POOL MEMBER foo/200.200.200.112:80   active,up
    
    [root@ve1023:Active] config  ab -c1 -n100 http://172.28.19.79/
    ...
    
    [root@ve1023:Active] config  b pool foo
    POOL foo  LB METHOD round robin   MIN/CUR ACTIVE MEMBERS 2/4
    |     (cur, max, limit, tot) = (0, 2, 0, 100)
    |     (pkts,bits) in = (500, 287200), out = (500, 597200)
    +-> POOL MEMBER foo/200.200.200.101:80   active,up
    |   |     session enabled    priority 2    ratio 1
    |   |     (cur, max, limit, tot) = (0, 1, 0, 50)
    |   |     (pkts,bits) in = (250, 143600), out = (250, 366000)
    |   |     requests (total) = 50
    +-> POOL MEMBER foo/200.200.200.102:80   active,up
    |   |     session enabled    priority 2    ratio 1
    |   |     (cur, max, limit, tot) = (0, 1, 0, 50)
    |   |     (pkts,bits) in = (250, 143600), out = (250, 231200)
    |   |     requests (total) = 50
    +-> POOL MEMBER foo/200.200.200.111:80   active,up
    |   |     session enabled    priority 1    ratio 1
    |   |     (cur, max, limit, tot) = (0, 0, 0, 0)
    |   |     (pkts,bits) in = (0, 0), out = (0, 0)
    |   |     requests (total) = 0
    +-> POOL MEMBER foo/200.200.200.112:80   active,up
        |     session enabled    priority 1    ratio 1
        |     (cur, max, limit, tot) = (0, 0, 0, 0)
        |     (pkts,bits) in = (0, 0), out = (0, 0)
        |     requests (total) = 0
    
    [root@ve1023:Active] config  b pool foo|grep -i pool\ member
    +-> POOL MEMBER foo/200.200.200.101:80   inactive,down
    +-> POOL MEMBER foo/200.200.200.102:80   active,up
    +-> POOL MEMBER foo/200.200.200.111:80   active,up
    +-> POOL MEMBER foo/200.200.200.112:80   active,up
    
    [root@ve1023:Active] config  ab -c1 -n100 http://172.28.19.79/
    ...
    
    [root@ve1023:Active] config  b pool foo
    POOL foo  LB METHOD round robin   MIN/CUR ACTIVE MEMBERS 2/3
    |     (cur, max, limit, tot) = (0, 3, 0, 100)
    |     (pkts,bits) in = (500, 287200), out = (500, 551368)
    +-> POOL MEMBER foo/200.200.200.101:80   inactive,down
    |   |     session enabled    priority 2    ratio 1
    |   |     (cur, max, limit, tot) = (0, 0, 0, 0)
    |   |     (pkts,bits) in = (0, 0), out = (0, 0)
    |   |     requests (total) = 0
    +-> POOL MEMBER foo/200.200.200.102:80   active,up
    |   |     session enabled    priority 2    ratio 1
    |   |     (cur, max, limit, tot) = (0, 1, 0, 33)
    |   |     (pkts,bits) in = (165, 94776), out = (165, 152592)
    |   |     requests (total) = 33
    +-> POOL MEMBER foo/200.200.200.111:80   active,up
    |   |     session enabled    priority 1    ratio 1
    |   |     (cur, max, limit, tot) = (0, 1, 0, 34)
    |   |     (pkts,bits) in = (170, 97648), out = (170, 157216)
    |   |     requests (total) = 34
    +-> POOL MEMBER foo/200.200.200.112:80   active,up
        |     session enabled    priority 1    ratio 1
        |     (cur, max, limit, tot) = (0, 1, 0, 33)
        |     (pkts,bits) in = (165, 94776), out = (165, 241560)
        |     requests (total) = 33
    
    

    thanks!