Forum Discussion

keith_varga_107's avatar
Icon for Nimbostratus rankNimbostratus
May 11, 2012

limiting connections as well as allowing if all limits are reached

DevCentral Team,



Here is our current irule just below. it works fine, but the development team now wants to include the the following in addition to this rule. Also, once we see how to accomplish what they're asking, can we combine the rules (current irule included below)?



developer's question:


Is there a version of the load balancing rules to go to the next server in the pool when the current server has 300 connections? If all the servers have 300 connections I still want the F5 to send the request to a server. I'm just want to try and avoid more than 300 connections.




Current irule:




HTTP::header insert "X_CLIENT_IP" [IP::client_addr]


HTTP::header insert "X-Forwarded-For" [IP::client_addr]


if { [string tolower [HTTP::uri]] contains "/pmcserver/checkforwork" } {


pool pm2_qa_web




} elseif { [string tolower [HTTP::uri]] contains "pmcserver" } {


pool pm2_qa_pmcserver


return }


elseif { [string tolower [HTTP::uri]] starts_with "/partner" } {


pool pm2_qa_soap


return } else {


pool pm2_qa_web return







Also, today, our developer had this suggestion as well. Would this approach be the way to go?



Roughly speaking... Start with a pool that limits its members to 300 connections. Lets call it pmcserver300-pool. Next, create a standard round robin pool called pmcserver-pool. Then create a rule roughly like... if (pmcserver300-pool(connection) == false) { pmcserver-pool(connection) } This assumes of course that sending a request to the pmcserver300-pool when all members are at their max 300 connections, that the connection failure can be caught and redirected to another pool.




thanks much,



2 Replies

  • Why not just set your pools to use the least connections load balancing method? This will cause load balancing to occur based on the number of connections and you won't have to worry about code getting in the way and causing unnecessary over head.



    Least Connections (member): Specifies that the system passes a new connection to the node that has the least number of current connections in the pool. This method works best in environments where the servers or other equipment you are load balancing have similar capabilities. This is a dynamic load balancing method, distributing connections based on various aspects of real-time server performance analysis, such as the current number of connections per node or the fastest node response time.




    You may also want to set a slow ramp time on the pool to keep a pool member from being flooded when it gets marked up by the monitor.






    Slow Ramp Time: Specifies the duration during which the system sends less traffic to a newly-enabled pool member. The amount of traffic is based on the ratio of how long the pool member has been available compared to the slow ramp time, in seconds. Once the pool member has been online for a time greater than the slow ramp time, the pool member receives a full proportion of the incoming traffic. Slow ramp time is particularly useful for the least connections load balancing mode.



  • Bryce,



    Thanks very much for the response. The slow ramp time option does makes sense for this situation. I've sent the developers this information, and they view it as promising, and are going to try it out.



    thanks again,