Forum Discussion
Joe_D_Rozario_4
Nimbostratus
Jan 12, 2007Preferential sorry page
I am VERY new at BigIp and iRules. I need some validations and suggestions in writing the iRules to manage high traffic situations on our site.
We want to show "sorry page" when the traffic is high but not at the breaking point yet. But we want to let the customers in who are in process
of buying (checking out or something in the shopping cart) or in secured sessions (logged on and checkout).
Couple of questions:
1. Which count serves the purpose better CLIENT_ACCEPTED or SERVER_CONNECTED ?
2. Is serving the "sorry page" from iRule using HTTP_RESPOND a better approach ?
Thanks
--------------------------------------------------
1 iRule reset_conn_counts_01
when RULE_INIT {
set ::tcc 0
set ::tcs 0
log local0. "Reseting: tac =$::tcs tcc=$::tcc"
}
--------------------------------------------------
2 iRule show_site_busy_01
when HTTP_REQUEST {
set ::shop_cart_value 0
if { ($::tcc > 50)} {
set ::shop_cart_value [HTTP::cookie "shop_cart"]
if { ($::shop_cart_value < 1 ) } {
HTTP::redirect "http://some.site.com/site_busy"
}
}
}
--------------------------------------------------
3 iRule count_conn _01
when CLIENT_ACCEPTED {
incr ::tcc 1
}
when CLIENT_CLOSED {
incr ::tcc -1
}
when SERVER_CONNECTED {
incr ::tcs 1
}
when SERVER_CLOSED {
incr ::tcs -1
}
--------------------------------------------------
- Deb_Allen_18Historic F5 AccountCheck this iRule I just now added to the codeshare -- seems to have worked for a number of customers, and may work for your application, assuming the clients support cookies:
- Leslie_South_55
Nimbostratus
Deb,
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