[syslog-ng] Profiling syslog-ng

Balazs Scheidler bazsi at balabit.hu
Tue Mar 14 23:42:48 CET 2006


On Tue, 2006-03-14 at 16:07 -0500, John Morrissey wrote:
> On Tue, Mar 14, 2006 at 12:19:52AM +0100, Balazs Scheidler wrote:
> > The latest 1.9.x snapshot already has this behaviour, although I'd
> > understand you hesitate going from 1.6.x -> 1.9.x in a sudden move.
> > 
> > What about the following (compile-tested) patch:
> 
> This looks good and is working well - thanks!
> 
> One more thing I've noticed: syslog-ng is making huge numbers of time(2)
> calls. Our hub is calling time() 14-18,000 times/second(!) at peak. Is there
> a way to optimize this away, or is 1.9.x more frugal in calling it?

Maybe it calls somewhat less, but not significantly as it still calls
time() for each message, and maybe even multiple times.

How expensive do you think calling time() is?

> 
> I'm thinking a global time_t might be useful, with periodic updates
> triggered by a timer every n msec. I'm not sure what guarantees are provided
> for timers, though, especially under heavy load. Thoughts?

a global variable updated in every poll loop might be ok, but timers
otherwise are not too reliable. to make things worse, syslog-ng 1.9.9
supports second fractions, e.g. individual messages have different
timestamps, using a global variable would be bad.

-- 
Bazsi



More information about the syslog-ng mailing list