Forum Discussion
juergen_lampar1
Nimbostratus
Jun 24, 2014dynamic loadbalancing using value from node
hi,
can i dynamic loadbalaning with values from the node´s application?
the application writes a score from 1 to 10 in a file.
can the LTM this score in a table writing and the node with the best sco...
Kevin_Stewart
Employee
Jun 24, 2014Two things worth considering:
-
If you needed this to be a real-time thing, then you'd necessarily have to query each server and compare scores on each new user session. To do this you'd use a series of sideband calls inside an iRule, and that would invariable add some latency.
-
Doing this in a monitor makes it, by definition, an asynchronous process, so you could just as well have a script poll all of the servers periodically and then update ratio values of a given pool. Something like this:
!/bin/bash define pool name pool="local-pool"; define pool member listener port port=80; arr=($(tmsh list ltm pool $pool |grep address |awk -F" " '{ print $2 }')); for x in "${arr[@]}" do score=`curl -fNs http://$x/score.php`; tmsh modify ltm pool $pool members modify { $x:$port { ratio $score } }; done
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