Moritz_Möller_6
Feb 14, 2006Nimbostratus
iRule says "pool a" but request is going to pool b
Hi Forum,
i have a problem that's driving me crazy...
This is my iRule:
when HTTP_REQUEST {
set fn [URI::basename [HTTP::uri]];
set ext [string range $fn [string last "." $fn] 999];
if { [ matchclass $::static contains $ext ] } {
HTTP::header replace "Dbg" "static";
pool "static";
} else {
HTTP::header replace "Dbg" "game-www";
pool "game-www";
}
}
class $::static contains .gif, .jpg etc.
pool static contains a node for static content, pool game-www contains several nodes for dynamic content.
Now if i Dump the requests going to the Servers (Dump-Script attached), i see requests on the static webserver that should go to the game-www pool (the Dbg header says "game-www").
> game-www3:~ dumpHttpRequests | grep static
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
> listening on eth0, link-type EN10MB (Ethernet), capture size 4096 bytes
> [bigip.4840->game-www3.80] http://www.lofd.de/pict/li-h.jpg [static]
The value in square brackets is the contents of the Dbg header.
Any idea how this can happen?
[Edit]
Only a really small amount (0.1% of all requests) go to wrong pools. I dumped the HTTP::request_num value with each request and noted that it is always >1.. We use a OneConnect-Profile, but the error occurs if it is disabled, too.
[Edit2]
I appendet the following code after the pool xxx statement:
pool "static"
if { [LB::server pool] != "static" } {
log "err1 [LB::server pool] != static"
}
occasionally i see these error messages in the log file. once a second maybe. why does this only happen sometimes?
[Edit3]
It seems as if the problems occur on some Keep-Alive Connections.
If i add a 'when HTTP_RESPONSE { HTTP::close; }' the errors go away.
Looks like the pool selection is persistent for all requests coming from a single connection?
log "[LB::server pool]" at the very beginning of the rule occasionally prints "static" although the default pool is "game-www".