Hi,
I find nice iRule that will limit connections.
Someone knows what will the load on f5 with this script ? I am planning to limit one of the virtuals to 14000 connections and redirect all new connection to another url.
I want to use this script:
rule session_limit {
when RULE_INIT {
set ::total_active_clients 0
set ::max_active_clients 50
}
when HTTP_REQUEST {
; If persistence cookie already exists,
; allow persistent connection without incrementing counter
if { [HTTP::cookie exists "BIGipServerhalifax"] } {
pool halifax
return
; If no cookie, check for URI link parameter
; & redirect if present
} else {
if { [HTTP::uri] contains "linkID=halifax" } {
HTTP::redirect "http://pleasehold.evenue.net/bigip/nocookies.html"
return
}
; Still no cookie
; Check limit vs. active
; Allow in if there's room, and incr counter for this new cnx
if { $::total_active_clients < $::max_active_clients } {
incr ::total_active_clients
pool halifax
return
; otherwise redirect
} else {
HTTP::redirect "http://www.yahoo.com/"
return
}
}
}
when CLIENT_CLOSED {
incr ::total_active_clients -1
}
}
Is there any other recommended script to limit connection on virtual ?
Thanks,
Alex Webs