Hi. This discussion got me thinking would it be possible for HAproxy to query a 
PHP/Perl/Python...-script that returns some kind of numerical information 
concerning the server's load. For example HAproxy could check periodically
  http://server_name/load_status
where the 'load_status'-script would return something like
  performance_index     0.92
Ideally the performance_index should be 1.00, but under heavy load the index 
would be lower. HAproxy could then multiply the basic server weight with this 
performance_index.

For example there could be three servers
        server  Aserver  192.168.0.1:80 cookie Acookie check inter 2000 weight 
100
        server  Bserver  192.168.0.2:80 cookie Bcookie check inter 2000 weight 
100
        server  Cserver  192.168.0.3:80 cookie Ccookie check inter 2000 weight  
80

If all servers are working optimally under light load all of them would return 
a performance_index of 1.00. However if server A should be under heavy load, it 
would return performance_index 0.5. The server B is somewhat less loaded 
returning performance_index 0.8 and C lightly loaded returning 0.95 the dynamic 
weights would be
        server A:       100 * 0.5       = 50
        server B:       100 * 0.8       = 80
        server C:    80 * 0.95  = 76

The beauty is that every administrator could tweak the 'load_status'-script at 
his/her heart's will taking into consideration just his/hers own server farm's 
typical use and properties by choosing what performance data (CPU usage, CPU 
load, io_wait, average/maximum response time...) he/she wants to use when 
calculating the performance_index.

Best, B

 

__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 4522 (20091019) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


Reply via email to