Forum Discussion
keith_varga_107
May 17, 2012Nimbostratus
fixed HTTP page automatically when the # connections for the node is reached
DevCentral Team,
We have the following irule:
when HTTP_REQUEST {
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" } {
pool pm3_qa_pmcserver
return
} elseif { [string tolower [HTTP::uri]] starts_with "/partner" } {
pool pm3_qa_soap
return
} else {
pool pm3_qa_web
return
}
}
Within the pm3_qa_pmcserver pool, we have two nodes that accept traffic, and have the pool set to least connections LB method. The developers would like to know of a way we can adjust our irule to do the following:
If traffic bound to the node residing in the pm3_qa_pmcserver pool surpasses the F5 connection limit that is set for that node, send the user to a fixed HTTP page automatically.
The mission is to not overwhelm the pmc server program on the backend if the F5 connection limit is already reached, and just let the F5 send the user to a url telling them the PMC program is 'too busy' instead.
thanks much, Keith Varga
- George_Watkins_Historic F5 AccountIf the node limit is reached the LB_FAILED event will be triggered. This iRule should do the trick:
when LB_FAILED { HTTP::redirect "http://mysite.com/over-limit.html" }
- keith_varga_107NimbostratusGeorge,
- George_Watkins_Historic F5 AccountKeith,
when HTTP_REQUEST { 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" } { pool pm3_qa_pmcserver } elseif { [string tolower [HTTP::uri]] starts_with "/partner" } { pool pm3_qa_soap } else { pool pm3_qa_web } } when LB_FAILED { HTTP::redirect "http://mysite.com/over-limit.html" }
- keith_varga_107NimbostratusGeorge,
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