On Sun, 22 Aug 2004 22:19, Lennert Buytenhek <buytenh@xxxxxxxxxxxxxx> wrote: > On Sun, Aug 22, 2004 at 10:12:00PM +1000, Russell Coker wrote: > > In most cases synchronous writes for logs just reduces performance for no > > benefit. > > (I didn't check whether it does this already.) Wouldn't it be possible > to speed up synchronous syslogging with something like this: > > That way, if you get a burst of log messages, the first sync write > would write out just a single line, and all the next writes would > write out everything that accumulated in the buffer so far in one > single sync write. Your pseudo-code didn't clearly explain your intent. > That way, you still get sync behaviour, but without the > whole-disk-roundtrip-per-log-line overhead. Usually when there's a lot of logging the performance of the syslogd itself is not the issue. The problem is that synchronous writes kill file system performance and interfere with the performance of other programs in the system. Synchronous syslogd operation can reduce performance of a server that's bottlenecked by disk writes by 20% or more. For a serious mail server you don't want the mail facility log entries to go to a synchronous file. The synchronous writes to the mail queue and for mail delivery hurt enough. If the performance of the syslogd itself is the issue then you have no option but to turn off synchronous writes. For this situation it would be good if there was an option to select whether the daemon should write directly but not synchronously or whether it should wait for page-sized buffers (IE use fwrite()). -- http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page