Forum Discussion
hooleylist
Jul 26, 2010Cirrostratus
I think Bhattman's example would work. But the downside to using a global counter is that it will prevent the VS from being "load balanced" across all of the TMM cores or CPUs (if you're on a CMP capable platform and LTM version). Another poster, Kev, came up with a simple solution for scenarios like this:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aff/5/afv/topic/aft/1172658/afc/1196453/Default.aspx
when HTTP_REQUEST {
if { rand() > 0.02 } {
pool default-pool
} else {
pool marketing-pool
}
}
You could adapt this to your scenario:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aff/5/afv/topic/aft/1172658/afc/1196453/Default.aspx
when HTTP_REQUEST {
Check if URI is one we want to redirect
if {[HTTP::uri] contains "search"}{
if { rand() > 0.70 } {
HTTP::redirect "http://uri1"
} else {
HTTP::redirect "http://uri2"
}
}
}
Aaron