Hi Alexander,
On Wed, Jan 20, 2010 at 02:08:18PM +0100, Alexander Staubo wrote:
> This is only tangentially related to HAProxy, but our sysadmins are
> coming up short, so I'm hoping someone on this list will be able to
> help.
>
> We are experiencing a lot of missing log entries when running HAProxy.
> We have set up HAProxy to log to localhost, which is running the
> standard Linux syslogd daemon. Apparently HAProxy logs using UDP, but
> should we be experiencing packet loss when logging locally?
it may happen depending on the load, your syslog daemon and its config.
The syslog daemon from the sysklogd package is generally OK up to 1000
logs per second on recent, and will start dropping some of them above.
However, it is important to note that this syslogd does synchronous
logging by default, which reduces its potential to only a few tens of
logs per second. You have to prepend a "-" sign in front of the log
file names to disable this feature, like this :
local0.* -/var/log/haproxy.log
Otherwise I really suggest using syslog-ng. It has numerous advantages
over syslogd, is much more efficient and you don't even need to replace
the old one. Just use syslog-ng for haproxy and don't touch your system's
syslogd. With a properly tuned syslog-ng server, you can generally log
10-20000 logs per second without any loss.
> Is it
> possible to configure HAProxy to log using TCP, or directly to a file?
I initially planned to rework the log subsystem for 1.4 but finally
did not. The rework would have included logging using TCP. So no, it's
not available, as well as logging to a file.
Also, keep in mind that TCP logging is generally much worse than UDP
at high packet drop rates, because the 3 second delays between a
retransmit are much more harmful than just one dropped packet, as
you can lose tens of thousands of lines due to a buffer full condition.
Regards,
Willy