Forum Discussion

Brian_Kinsey_10's avatar
Brian_Kinsey_10
Icon for Nimbostratus rankNimbostratus
Jun 11, 2008

Connection Limits

I have a pool with three servers; Server1, Server2, and Server3. I would like to force the first 1000 connections to all go to Server1. Once the connection limit is reached, persisting connections will stay on Server1, but all new connections will go to Server2, even when Server1 falls below 1000. Once Server2 reaches 1000 connections, only persisting connections will go to Server2. All new connections will go to Server3 (with no connection limit). Once connections start going to Server3, everything new will go to Server3 until I manually go in and re-enable Server1 and Server2.

 

 

Is it possible to do this using Priority Groups on the pool? Server1 will be in Priority Group 1 and the node will have a connection limit of 1000. Server2 will be in Priority Group 2 and the node will have a connection limit of 1000. Server3 will be in Priority Group 3 and the node will not have a connection limit. Will this solution set Server1 and Server2 to disabled once they reach the connection limit? And will it keep them disabled until I manually enable them?

 

 

If not, is there a way to set this up with an iRule?

3 Replies

  • I have done some more research, and it doesn't look like connection limits on the pool members will meet my requirements. I believe that once a member falls below the limit, it will start taking connections again, which I do not want to happen. I started working on an iRule....

    when RULE_INIT {     
       array set ::active_connections { }   
       }   
          
       when HTTP_REQUEST {     
       if LB::status pool pool1 member 10.10.10.1 up   
               set servername server1   
       if active_connections($servername) <= 1000   
       use pool pool1 member 10.10.10.1 80   
       incr ::active_connections($servername)   
       else LB::status pool pool1 member 10.10.10.1 80 down   
       use pool pool1 member 10.10.10.2 80   
                       set servername server2   
                       incr ::active_connections($servername)   
                          
       if LB::status pool pool1 member 10.10.10.2 80 up   
               set servername server2   
       if active_connections($servername) <= 1000   
       use pool pool1 member 10.10.10.2 80   
       incr ::active_connections($servername)   
       else LB::status pool pool1 member 10.10.10.2 80 down   
       use pool pool1 member 10.10.10.3 80   
                       set servername server3   
                       incr ::active_connections($servername)   
          
       else use 10.10.10.3   
               set servername server3   
       use pool pool1 member 10.10.10.3 80   
       incr ::active_connections($servername)   
          
       }   
          
       when CLIENT_CLOSED {     
              incr ::active_connections($servername) -1       
       }     
      

    I know I need more brackets, but other than that, will this work?
  • This VIP has multiple servers that connect to it as part of the same client connection. We need to make sure that all the connections go to the same server behind the VIP. This is easy if we have one server behind the VIP, but one server can't handle all of the connections. So our plan is to make it look like one server behind the VIP until it is full, then switch to the next server.

     

     

    Your suggestion sounds like it would work well and would be more efficient. I have a little experience with iRules, which is why I jumped to that. I do not know much at all about iControl. I will start researching, but any help would be appreciated.
  • aherrman's suggestion seems like a very interesting solution. However, if you're just trying to maintain sessions going to the same server for existing clients, why not use persistence and just load balance new requests evenly across servers?

     

     

    Aaron