Forum Discussion
chris_connell_1
Nimbostratus
Oct 05, 2009Testing 50 servers
Hi,
We have 50 servers to test and send traffic through, the probe which simulates a client generates a stream of traffic every half an hour.
The problem is that w...
hoolio
Cirrostratus
Oct 06, 2009Here's an example from hwidjaja which uses persistence to ensure the specific pool member is selected based on an initial request with a query string parameter indicating the node that should be used. Subsequent requests are persisted to that same pool member based on the source IP address.
iRule to Select alternate pool member based on QUERY_STRING
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=29295
You could modify it slightly to take advantage of the URI::query command to parse the query string parameter value:
when HTTP_REQUEST {
set time_out 3600
Check query string for node parameter. Expect a two digit number indicating the pool member
switch [URI::query [HTTP::uri] "node"] {
01 { set selected_node 192.168.49.97 }
02 { set selected_node 192.168.49.98 }
03 { set selected_node 192.168.49.99 }
default {
No node parameter in query string, so check if there
is an existing session table entry for this client IP
set selected_node [session lookup source_addr [IP::client_addr]]
}
}
Check if there was a matched node
if {$selected_node eq ""} {
No match, so use the default pool
pool [LB::server pool]
} else {
Found a match, so use that
pool [LB::server pool] member $selected_node
Add a session table entry based on the client IP, selected node address and the record timeout
session add source_addr [IP::client_addr] $selected_node $time_out
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
