Forum Discussion
DGordon
Nimbostratus
Jun 13, 2007Active Connection Counting
Hi everyone,
I have a pool that can currently only handle about 600 active connections. What I would like to do is use an iRule to monitor the active connections (as can be viewed in real time in the Pool Statistics), however searching on this forum I have found that this was not possible. That response was given over a year ago. Is this still the case?
I have been experimenting with the code sample located here:
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPSessionLimit.html
However I am seeing erratic behaviour if a user has cookies disabled (the active connections counter can increase by about 20 for a single page impression), in addition to the CLIENT_CLOSE being called before all requests have finished.
Does anyone have any alternative or better solutions for dynamically keeping track of current active connections and subsequently imposing redirects? Even External health monitors through some scripting and the like if anyone has explored that possibility.
Thanks in advance!
- DGordon
Nimbostratus
Nobody seems to have any other ideas, so i'll share my new solution... 😄virtualServerName - The name of the virtual server you want to monitor. poolName - The name of the pool you want to monitor. poolMembers - Names of pool members separated by a space. memberLimit - The number of connections each member (specified above) can accept, separated by a space.
andpoolMembers
are converted to an array in the script.memberLimit
!/bin/sh poolConnGrab=`bigpipe virtual ${virtualServerName} | grep conns | head -1` currConns=`expr "$poolConnGrab" : '[^0-9]*\([0-9]*\)'` connLimit=0 limitCount=0 memberLimit=(${memberLimit}) for poolMember in ${poolMembers} do logger "Pool Member ${poolMember}" if bigpipe virtual ${virtualServerName} | grep ${poolMember} | grep -q "UP" then logger "Server Is Up. Increasing Connection Limit." connLimit=`expr $connLimit + ${memberLimit[${limitCount}]}` else logger "Server is Down!" fi limitCount=`expr $limitCount + 1` done logger "Utilisation: ${currConns} of ${connLimit}" if [ $currConns -lt $connLimit ] then logger "Connections ACCEPTABLE" for poolMember in ${poolMembers} do bigpipe pool ${poolName} member ${poolMember} session enable done else logger "Connections UNACCEPTABLE" for poolMember in ${poolMembers} do bigpipe pool ${poolName} member ${poolMember} session disable done fi echo "up" exit 0
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects