cvs commit: src/usr.sbin/syslogd syslogd.c

Robert Watson rwatson at
Fri Mar 31 16:31:11 UTC 2006

On Fri, 31 Mar 2006, Alexander Leidinger wrote:

>>> Do you know if a kqueue based solution is cheaper?
>> Probably should not matter. Syslog writes data to disk synchronously, 
>> right? So anything not involving a disk access is negligible in cost 
>> compared to the main action of writing the log entry.
> Regarding syslogd: yes. Regarding the overal system: maybe. Regarding an 
> overloaded server: every cycle matters.
> When you can get the same (features, quality, nice design, ...) cheaper, why 
> not choose the cheaper one? I don't ask for premature optimization, I just 
> ask for not bloating something in the first place (if the difference in the 
> amount of work is small).

I think you'll find the cost of an fstatfs() call is so low that the cost of 
setting up monitoring is appreciably similar.  I think the right thing to do, 
if worried, is to prototype the architecturally simple solution, and then see 
if there's a problem.  Premature optimization is what happens when you 
complicate software in order to solve a performance problem that doesn't 
exist, possibly resulting in slower software, and certainly resulting in 
harder to maintain software.  :-)  I'm pretty sure you'll find that the cost 
of fstatfs() is basically unmeasurable in this context.

Robert N M Watson

More information about the cvs-src mailing list