Forum Discussion
abeny_894
Nimbostratus
Dec 04, 2008Colin, I have combine the iRules into one and shown as below:
Is there need changes and match the suggestion?? Thanks a lot~
--------------------------------------------------------
when HTTP_REQUEST {
switch -glob [HTTP::host][HTTP::uri] {
"test1.f5lab.com*" {
log local0. "hit test1.f5lab.com"
set site a
incr ::total_active_clients_a
log local0. "total requests are $::total_active_clients_a"
set start_time_a $cur_time_a
if { [LB::status pool websrv_REMOTE_pool member 10.1.1.1 80] eq "down" } {
pool websrv_busypool
return
}
if { $cur_time_a == $start_time_a } {
if { $::total_active_clients_a <= $::max_active_clients_a } {
pool websrv11_pool
return
}
}
if { $cur_time_a == $start_time_a } {
if { $::total_active_clients_a >= $::max_active_clients_a } {
pool websrv_busypool
return
}
}
}
}
switch -glob [HTTP::host][HTTP::uri] {
"*/app1/index.html" {
log local0. "hit test1.f5lab.com/app1/index.html"
set site a
incr ::total_active_clients_a
log local0. "total requests are $::total_active_clients_a"
set start_time_a $cur_time_a
if { [LB::status pool websrv_REMOTE_pool member 10.1.1.1 80] eq "down" } {
pool websrv_busypool
return
}
if { $cur_time_a == $start_time_a } {
if { $::total_active_clients_a <= $::max_active_clients_a } {
pool websrv11_pool
return
}
}
if { $cur_time_a == $start_time_a } {
if { $::total_active_clients_a >= $::max_active_clients_a } {
pool websrv_busypool
return
}
}
}
default {
log local0. "hit default"
set site a
incr ::total_active_clients_a
log local0. "total requests are $::total_active_clients_a"
set start_time_a $cur_time_a
if { [LB::status pool websrv_REMOTE_pool member 10.1.1.1 80] eq "down" } {
pool websrv_busypool
return
}
if { $cur_time_a == $start_time_a } {
if { $::total_active_clients_a <= $::max_active_clients_a } {
pool websrv11_pool
return
}
}
if { $cur_time_a == $start_time_a } {
if { $::total_active_clients_a >= $::max_active_clients_a } {
pool websrv_busypool
return
}
}
}
}
}
________________________________________________________