[syslog-ng] Profiling syslog-ng

Balazs Scheidler bazsi at balabit.hu
Thu Feb 16 09:56:30 CET 2006


On Wed, 2006-02-15 at 14:28 -0500, John Morrissey wrote:
> On Tue, Feb 14, 2006 at 10:48:33AM +0100, Balazs Scheidler wrote:
> > On Mon, 2006-02-13 at 10:57 -0500, John Morrissey wrote:
> > > On Sun, Feb 12, 2006 at 08:07:14PM +0100, Balazs Scheidler wrote:
> > the problem is that it is not so simple, this code is in libol, it is
> > generic and the program relies on this behaviour at a lot of places. (to
> > request a read callback, it simply changes the value for a want_read
> > value, no functions called to update the pollfd state)
> 
> FWIW, I modified syslog-ng 1.6.9 to usleep(10000) at the end of the
> io_iter() loop in src/main.c. This dropped CPU consumption by about fourfold
> - instead of spinning in that io_iter() loop, reading one or two messages
> per poll(), it's now reading several (3-15) messages per poll().
> 
> Increasing the time to 20000 usec cuts CPU in half again - to about 1/8 of
> the original consumption. It's now using ~10-15% of a CPU under the same
> heavy log load from ~750 connections. Granted, this increases latency, but I
> don't think 10 or 20 msec delays will kill anything.

The idea is cool, although I have to admit it is really a hack :)

This might be useful to others as well. I will probably add it as a
global option. Thanks for tracking this down.

-- 
Bazsi



More information about the syslog-ng mailing list