Forum Discussion
Mike_S_59924
Nimbostratus
Nov 15, 2008dealing w/ heavy load via try again later site
We would like to setup up two nodes in a pool as follows.
All traffic goes to node 1 until there there are 500 connections.
After that traffic goes to node 2 which is a site that just...
hwidjaja_37598
Altostratus
Nov 17, 2008Try this:
when RULE_INIT {
set ::MaxConn 500
set ::CurConn 0
set ::RejectList [list / .html .htm .asp .pl ]
}
when CLIENT_ACCEPTED {
incr ::CurConn
}
when CLIENT_CLOSED {
incr ::CurConn -1
}
when HTTP_REQUEST {
if {
($::CurConn > $::MaxConn) and \
([matchclass [HTTP::path] ends_with $::RejectList]) \
} {
HTTP::respond 200 content "
Please Try again later
Please Try again later
"
drop
}
}
The iRule will only block html document and still allow non-html document (eg. image/flash/video).
It's using global variable which means it doesn't work perfectly in CMP platform (1600, 3600, 8400, 8800 and Viprion). As a 'workaround', you divide MaxConn with number of tmm process in yous system (eg. ps | grep npus). Statistic Profile might be better in CMP platform.
Modify it according to your environment.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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