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

Alexander Leidinger Alexander at
Fri Mar 31 14:28:31 UTC 2006

Sergey Babkin <babkin at> wrote:

>> Robert Watson <rwatson at> wrote:
>>> The cost to check for free space is the cost of a fstatfs() system
>>> call on the file descriptor of the log file.  This should be handled
>>> without touching the disk, so while it's not a cheap system call
>>> compared to, say, getpid(), as it acquires locks and enters VFS, it's
>>> a lot cheaper than any disk I/O operation. Optional is good, if only
>>> because sometimes people do actually want logging to fill the disk,
>>> and that's been the behavior historically :-).
>> 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).


--  Alexander @ PGP ID = B0063FE7     netchild @  : PGP ID = 72077137
If you don't say it, they can't repeat it.

More information about the cvs-src mailing list