Nginx changing settings on the fly?

YesThatGuy nginx-forum at nginx.us
Fri Jul 26 21:18:57 UTC 2013


We're currently using CrossRoads for our load balancing needs and are
evaluating a switch to Nginx. We are excited by the existence of a
pacemaker/heartbeat ocf script. But one of the needs that we have is that
our web servers have somewhat volatile load averages. Some hits cause a
tremendous amount of processing, most others cause very little. 

The nginx config option "weight" allows you to balance how much load to
preferentially give to which host, but can this option be changed in value
without restarting nginx? I would want to default to "1" and then have each
logic server announce to the load balancer what weight should be used, in
short intervals. 

Crossroads has a web-based admin interface that we use to set an equivalent
value in crossroads so that busy servers are effectively "routed around"
until their load drops to a more normal value. 

In Crossroads' case it would look something like: 

#! /bin/sh 
loadbalancer="crossroads.mycompany.com" 
servername="alphabits" 
weight="4.5"
wget http://$loadbalancer/$servername/load/$weight

Does nginx have a feature like this?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,241311,241311#msg-241311



More information about the nginx mailing list