Forum Discussion
kyn3s_53106
Nimbostratus
Feb 03, 2010Loadbalancing URI on same server ?
Hello folks !
I have an unusual request to submit to your skills. I have two web servers running a proprietary solution. For some dark reasons (process loadbalancing, proc...
The_Bhattman
Nimbostratus
Feb 03, 2010Hi Kyn,
In that your original code is pretty close to what you wanted
However, here is a slight alteration:
You would create a default pool containing the 2 webservers listening on port 8080. You can set that as least connections.
The following
when RULE_INIT {
set ::rr_counter 0
}
when HTTP_REQUEST {
if {[HTTP::host] eq "www.yourapp.com" and [HTTP::uri] eq "/" }
Check the counter value
switch $::rr_counter {
0 {
HTTP::redirect "http://[HTTP::host]/toto1.exe
set ::rr_counter 1
}
1 {
HTTP::redirect "http://[HTTP::host]/toto2.exe
set ::rr_counter 0
}
}
}
}
The thought here is that when the clients come to the virtual server for the first time he/she or a device will first be given either toto1.exe or toto2.exe. When client is redirect back, the Load balalncing algorithm (in your case least connections) and forward it to one of the 2 servers in the pool containing either toto1.exe ro toto2.exe URI.
This is untested but I think it might help
Bhattman
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