Here is the set up we have -
There are several servers each listening on multiple ports.Several client machines run the client application.
Client application is started.
Client opens x number of sockets using a VIP and port.
We want number of new sockets opened to be round robbin load balanced between diff. servers and ports.
The client logs into each server and starts sending requests(PSH,ACK) over existing connections.
So if client has an existign connection with server x port y, then we want that request to go to that server and port combination.
Since we have several client machines connecting to same set of servers, we cannot use source ip address persistence.
We almost got to a point where the script seem to follow the right path(we are still printintg out to logs to see if the right event gets triggered):
when CLIENT_ACCEPTED {
TCP::collect 6
log local0. "HERE 1"
}
when CLIENT_DATA {
set payload_string [TCP::payload]
log local0. "data [TCP::payload]"
if {$payload_string contains "LOGIN"} {
pool mypool
log local0. "new"
} else {
log local0. "HERE 2"
set src_ip_and_port [TCP::client_port]
log local0. "src port <$src_ip_and_port>"
if { $src_ip_and_port != "" } {
log local0. "persist"
} else {
log local0. "error1"
}
}
TCP::release
}