Lukas Tribus wrote on 12/05/2014 12:09 PM:
[CUT]
You should work on your health checking and implement it in a way
that HAProxy can detect bad servers. That is the proper way to
deal with such problems.

Sometimes, providing a helper script on the backend that detects any
problems can help with this.

I did this, by implement a default vhost (on all servers - listening on hostname) with a 5 line script (in php -it was fastest), which simply checks for the existence of a file (called enable) and if you need to, could run a few other simple checks.

this script is then called by haproxy every 2 seconds (it takes  ~12msecs)

I then have a cron job, which does the heavy lifting of checking that the site actually works properly.. I look at access logs f.ex. - and if a certain percentage of requests is returned with a 500 status, it checks with haproxy (using a ssh remote-command setup) how many are "enabled" in it's webcluster, and if enough are available - it simple removes the "enable" file - and the server is taken out.

--
Regards,
Klavs Klavsen, GSEC - k...@vsen.dk - http://www.vsen.dk - Tlf. 61281200

"Those who do not understand Unix are condemned to reinvent it, poorly."
  --Henry Spencer


Reply via email to