Sunday, November 7, 2010

Another F5 iRule

I want to pull some percentage of the traffic off and send it to one web server pool and send everything else to a different pool.

Simplest way to do it would seem to be by the last digit of the number of seconds -- that gives me granularity of 10% at a time. To start off, I'm doing just 10% of the traffic, so I'll pick requests with seconds ending in "0"

when HTTP_REQUEST {
if { [HTTP::uri] equals "/directme" } {
set foobaz [clock seconds]
if { $foobaz ends_with "0"} {
pool special
}
else {
pool normal
}
}
}

No comments:

Post a Comment

Followers

About Me

My photo
Regis has worked as a network engineer since 1994 for small companies and for large companies.