Hello,

first, please avoid sending HTML mails to mailing lists, thanks.

On Mon, Jul 27, 2009 at 09:47:14AM +1000, William Angus wrote:
> Thanks for that, as it turns out (hangs head in shame) the problem was
> with syslog. I had not configured HAProxy to usr the local0 socket
> properly.

for more precision, local0 is not a socket, it's called a facility. It's
just a number at the beginning of the message corresponding to a syslog
channel approximatively, so that you're not forced to mix all your messages
together.

> I should have had the entry !haproxy above the local0 entry
> instead of +127.0.0.1 this allowed the haproxy process to communicate
> with the log. Logging works fine now. I also added the entry +localhost
> to the top of /etc/syslog.conf but I don't really think that had much
> to do with it.

The one you added to your rc.conf is important, because it is the one
indicating syslog it has to listen to UDP messages :

> --from /etc/rc.conf:
> apache22_enable="YES"
> syslogd_flags="-a 127.0.0.1:*"


> --from /etc/syslog.conf
> local0.* /var/log/haproxy.log

I don't know for FreeBSD, but some syslog daemons tend to perform synchronous
logging by default, unless you prefix the filename with a '-' like this :

  local0.* -/var/log/haproxy.log

It is very important to disable synchronous logging because it could
saturate your machine's I/O capacity with just a few hundred requests/s.
With the '-', he writes become buffered and you can reach 10-100 times
more performance (and limit the wear of the disks but that's another issue).

> $ ps auxw | grep syslog
> root     1505  0.0  0.0  5692  1204  ??  Ss   Fri05PM   0:01.72 
> /usr/sbin/syslogd -a 127.0.0.1:*
> 
> in my haproxy.conf is:
> global
>   log 127.0.0.1   local0 notice

Seems OK. You should try to shut all your servers down, haproxy will emit
an 'emerg' level message. But some syslog are configured to broadcast these
messages to all consoles, which is very annoying. If so, you can add a max
level on your line to limit the output severity like this :

 global
   log 127.0.0.1   local0 notice err

Regards,
Willy


Reply via email to