Forum Discussion
pool statistics not working with pool selection in iRule (v10.2.4)
Hi,
we have created an iRule which does a pool selection based on the value of a cookie in the users request. The reason for this irule is to have the ability to do a confidence check on the application before external user can access the application. We have multiple applications behind the same Virtual so there is no default pool attached to the virtual.
This is the irule we are using:
when HTTP_REQUEST {
switch -glob [HTTP::cookie x-lbt1-cc] {
"orange" {set poolext "_orange" }
"green" { set poolext "_green" }
default { set poolext "" }
}
switch -glob [HTTP::uri] {
....
"/xxx/yyy/zzz/*" {
if { [active_members pool_url_appname$poolext ] > 0 } {
pool pool_url_appname$poolext
persist cookie insert appname$poolext
} else {
pool pool_url_sorry
persist none
}
}
....
and for each application we have three pools defined (production, orange and green)
pool_url_appname - includes both servers
pool_url_appname_orange - includes only the orange server
pool_url_appname_green - includes only the green server
We have tested the irule and it is functioning and we can select the orange or green server based on the cookie included in the request. But when I check the pool statistics all counters are still showing zeros for these pools.
We are using something similar in another setup but then there is only one application behind the virtual and there is a default pool attached to the Virtual and we have the following iRule:
when CLIENT_ACCEPTED {
set poolorange [LB::server pool]_orange
set poolgreen [LB::server pool]_green
set poolprod [LB::server pool]
}
when HTTP_REQUEST {
set orig_host [HTTP::header host]
switch -glob [HTTP::header "x-lbt1-cc"] {
"orange*" {
if { [active_members $poolorange] > 0 } {
pool $poolorange
}
else {
pool pool-sorry_orange
persist none
}
}
"green*" {
if { [active_members $poolgreen] > 0 } {
pool $poolgreen
}
else {
pool pool-sorry_green
persist none
}
}
default {
if { [active_members $poolprod] < 1 } {
pool pool-sorry
persist none
}
}
}
}
In this case the statistics are functioning as expected. The only difference I can think of is that there is no default pool used in the setup that is not showing statistics.
I have found the following devcentral question which looks like a similar issue: https://devcentral.f5.com/questions/no-statistics-for-siebel-8-app-pools-selected-by-irules
Is this a known bug when using pool selection in this manner?
4 Replies
- nitass
Employee
it seems okay here. i am running 10.2.4 hf7.
version root@ve10(Active)(tmos) show sys version|grep -A 6 Package Main Package Product BIG-IP Version 10.2.4 Build 817.0 Edition Hotfix HF7 Date Mon May 20 15:08:56 PDT 2013 config root@ve10(Active)(tmos) list ltm virtual bar ltm virtual bar { destination 172.28.24.9:http ip-protocol tcp mask 255.255.255.255 profiles { http { } tcp { } } rules { qux } snat automap } root@ve10(Active)(tmos) list ltm rule qux ltm rule qux { when HTTP_REQUEST { set test "oo" pool f$test } } root@ve10(Active)(tmos) list ltm pool foo ltm pool foo { members { 200.200.200.101:http { } } } client [root@centos1 ~] ab -n 100 http://172.28.24.9/ stats root@ve10(Active)(tmos) show ltm pool foo members Ltm::Pool: foo --------------------------------- Status Availability : unknown State : enabled Reason : Traffic ServerSide Bits In 286.4K Bits Out 495.2K Packets In 500 Packets Out 500 Current Connections 0 Maximum Connections 2 Total Connections 100 Ltm::Pool Member: foo 200.200.200.101:80 ------------------------------------------------------------------- Status Availability : unknown State : enabled Reason : Pool member does not have service checking enabled Traffic ServerSide General Bits In 286.4K - Bits Out 495.2K - Packets In 500 - Packets Out 500 - Current Connections 0 - Maximum Connections 2 - Total Connections 100 - Total Requests - 100 - Remco
Nimbostratus
Hi,
we are running 10.2.4 HF5, this virtual and pool are also not configured in the default route-domain. Not sure if that is also making a difference.
- nitass
Employee
version root@B1600-R66-S18(Active)(tmos) show sys version |grep -A 6 Package Main Package Product BIG-IP Version 10.2.4 Build 732.0 Edition Hotfix HF5 Date Mon Dec 17 09:35:18 PST 2012 config root@B1600-R66-S18(Active)(tmos) list ltm virtual bar ltm virtual bar { destination 100.100.100.19%1:http ip-protocol tcp mask 255.255.255.255 profiles { http { } tcp { } } rules { qux } snat automap } root@B1600-R66-S18(Active)(tmos) list ltm rule qux ltm rule qux { when HTTP_REQUEST { set test "oo" pool f$test } } root@B1600-R66-S18(Active)(tmos) list ltm pool foo ltm pool foo { members { 200.200.200.101%1:http { } } } stats root@B1600-R66-S18(Active)(tmos) show ltm pool foo members Ltm::Pool: foo --------------------------------------------------------------------------------------------------------------------------------------- Status Availability : unknown State : enabled Reason : The children pool member(s) either don't have service checking enabled, or service check results are not available yet Traffic ServerSide Bits In 288.8K Bits Out 495.2K Packets In 500 Packets Out 500 Current Connections 0 Maximum Connections 2 Total Connections 100 Ltm::Pool Member: foo 200.200.200.101%1:80 ------------------------------------------------------------------- Status Availability : unknown State : enabled Reason : Pool member does not have service checking enabled Traffic ServerSide General Bits In 288.8K - Bits Out 495.2K - Packets In 500 - Packets Out 500 - Current Connections 0 - Maximum Connections 2 - Total Connections 100 - Total Requests - 100 - Remco
Nimbostratus
Last weekend our F5's have been upgraded to v11.4.1 HF2 and now pool statics do function as expected. So problem solved for now, but strange why it was not working in v10.2.4
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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