I was getting a lot of 502 bad gateway errors using HaProxy and searched
for a solution for a long time.
In my log files the following rows appeared:
Mar 4 15:23:46 localhost haproxy[13012]: xxx.xxx.xxx.xxx:60541
[04/Mar/2010:15:23:46.696] public dynamic/dynamic_gate2 0/0/0/-1/0 502
204 - - SLNN 511/511/33/33/0 0/0 "GET /XXXX HTTP/1.1"
Mar 4 15:23:48 localhost haproxy[13012]: xxx.xxx.xxx.xxx:38939
[04/Mar/2010:15:23:48.529] public dynamic/dynamic_gate2 0/0/0/-1/0 502
204 - - SLNN 512/512/31/31/0 0/0 "GET /XXXX HTTP/1.0"
Mar 4 15:23:58 localhost haproxy[13012]: xxx.xxx.xxx.xxx:51184
[04/Mar/2010:15:23:58.193] public dynamic/dynamic_gate2 0/0/0/-1/0 502
204 - - SLNN 557/557/27/27/0 0/0 "GET /XXXX HTTP/1.1"
Mar 4 15:23:58 localhost haproxy[13012]: xxx.xxx.xxx.xxx:36110
[04/Mar/2010:15:23:58.706] public dynamic/dynamic_gate2 0/0/105/-1/106
502 204 - - SLNN 558/558/40/40/0 0/0 "GET /XXXX HTTP/1.0"
These problems only occured when haproxy was connecting to another
server over the ethernet to retrieve content.
It didn't matter if it was static or dynamic content. (I 'm using apache
for dynamic and varnish with lighttpd for static content)
Then I realised that I had enabled polling on my network cards.
Disabling polling stopped the errors!
ifconfig em0 -polling
For information about Network Polling:
http://www.cyberciti.biz/faq/freebsd-device-polling-network-polling-tutorial/
Regards,
Rudy
Received on 2010/03/05 15:03
This archive was generated by hypermail 2.2.0 : 2010/03/05 15:15 CET