Forum Discussion
Sulabh_Srivasta
Mar 20, 2020Cirrus
Connection limit on virtual server and message back to client
I am trying to set max connection limit and connection/sec on a virtual server, once the max connection limit is reached can LTM send message back to client that " it is over limit, please try after ...
Sulabh_Srivasta
Mar 21, 2020Cirrus
For testing, I am using this iRule but it is not working :
when RULE_INIT {
set ::active_connections 0
set ::max_connections 2
set ::html_content "over_limit"
}
when CLIENT_ACCEPTED {
set over_limit 0
if {$::active_connections > $::max_connections } {
set over_limit 1
} else {
incr ::active_connections 1
}
}
when HTTP_REQUEST {
if {$over_limit}{
HTTP::respond 200 content $::html_content
HTTP::close
}
}
when CLIENT_CLOSED {
incr ::active_connections -1
}
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