Forum Discussion
cokeefe28_17139
Nimbostratus
Jun 09, 2009Load Balance PERSISTENT connection based on HTTP::Method
I have an issue where a persistent connection is being made to a VIP. I need to LB across 5 nodes in a pool. The only way that I think that this can be done is by LB based on each POST method that i...
jeff_mccombs_47
Nimbostratus
Jun 12, 2009There are a couple of possibilities on this.
Couple of questions first though;
1. Do you ONLY need to be sticky on POSTs, or is it OK to be sticky for GET's (and possibly others) as well?
2. Will a single source IP address (client) ever create more than a single persistent connection to the virtual server?
3. Does the client understand cookies?
4. Is there something the application is using to identify a particular client or track state (e.g. JSESSIONID?)
If you don't care about the GETs..
... and If the clients understand cookies, you don't even need an irule really - just create the virtual server they are using and set the persistence method to cookie.
... and If a client will only make ONE persistent connection to the VS, just use a source_addr persistence method.
... and If the backend app/web service the client is exchangin ginformation with uses something like a JSESSIONID variable set in a header, setup a universal persistence method based on that header value.
OR if you DO care abou the Gets...
.. everything else still applies, but you will need an irule then. A simple one would be;
when HTTP_REQUEST {
if { [HTTP::method] equals "POST" } {
persist source_addr [IP::client_addr]:[TCP::client_port]
}
} else {
persist none
}
For a source_addr based affinity. Just switch up that "persist src_addr blah" line to "persist universal" or "cookie" or whatever you need it to do.
HTH.
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