I had modify the iRules and the persistence works for a single user. However, when I do a load test with 10 users, I am hit by tcl error on iRules stating the following:
- can't read "cookie_value": no such variable while executing "
HTTP::cookie insert name webserver value $cookie_value"
Modify irules as the following:
when HTTP_REQUEST {
pool web_pool
if { [HTTP::cookie exists webserver] } {
persist uie [HTTP::cookie value webserver]
}
}
when HTTP_RESPONSE {
switch [IP::server_addr] {
172.10.20.1 { set cookie_value "webA" }
172.10.20.2 { set cookie_value "webB" }
}
HTTP::cookie insert name webserver value $cookie_value
persist add uie $cookie_value
}
The load test result was terrible with 50% errors flag out.