[lug] Performance Issues with syslog Shell Interface?

Scott Herod herod at dimensional.com
Wed Feb 4 20:52:06 MST 2004


On Wed, 4 Feb 2004, Dhruva B. Reddy wrote:

> My question was actually more basic--is it more expensive to redirect to
> syslog than a file (I'm told it is).

The answer is, "It depends."  If you never flush the buffer to which you 
are writing, it's roughly 3 to 5 times faster to write to a file than to 
syslog until of course it has to be flushed.  However, let me advise you 
to still use syslog.  It has easy filtering which is configurable at 
runtime and it plays nicely with logrotate.  Any webserver is going to 
operating at user time rather than machine time and while it is possible 
that logging will cause some speed hit, I am sure that it is minimal.

Be aware of "Premature Optimization".  I thing that's Herb Sutter's term.

I do use file based output without flushing only when I am doing my own 
profiling.  Otherwise, I would always use syslog.

Scott

> There is a fair amount of logging by Tomcat and 3rd-party libraries that
> I have yet to figure out how to stop.  But after some minimal testing
> (we're having trouble convincing the PTB of the need for a proper test
> environment :-(, I'm going to try it out.
> 
> Thanks for your responses,
> Dhruva
> 




More information about the LUG mailing list