From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 12961 invoked from network); 8 Jan 1999 01:51:23 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 8 Jan 1999 01:51:23 -0000 Received: from draal.physics.wisc.edu (mcelrath@draal.physics.wisc.edu [128.104.223.134]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id UAA04329 for ; Thu, 7 Jan 1999 20:31:36 -0500 Received: from localhost (mcelrath@localhost) by draal.physics.wisc.edu (8.8.7/8.8.7) with ESMTP id TAA25287 for ; Thu, 7 Jan 1999 19:31:10 -0600 Date: Thu, 7 Jan 1999 19:31:10 -0600 (EST) From: Bob McElrath To: axp-list@redhat.com Subject: Re: syslogd revisited In-Reply-To: <199901080104.CAA19989@noc.spin.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 8 Jan 1999, furio ercolessi wrote: > > > However, I am rather unhappy with the amount of CPU which > > > syslogd seems to use under normal circumstances. > > > For instance, right now I observe a syslogd using about 60-70% > > > of a 533MHz LX to write about 13kB per minute on a file. > > > This is ridiculous. Heck, in this case the messages are generated > > > by sendmail, which does that while cruising along at 0.1% CPU. > > > > > > syslogd therefore appears as the principal bottleneck in > > > our systems' performance. Is anybody else observing that? > > > > 1) Turn off mail reporting (it generates high volume...) > > No, we cannot do that, we need the logs (we are an ISP). > > > 2) configure sendmail to NOT sync after a write. This may be where the CPU > > usage is coming from. Not from sendmail, but from the forced disk write > > (via sync). > > This was an excellent suggestion! I just discovered that you could > do that by putting a "-" prefix in front of the filename in > syslog.conf, as explained in sysklogd(8). It really worked. > syslogd usage went down to nearly zero, and the funny thing is that > error messages seem to go out instantly to the disk file anyway. Perhaps create a separate mail log and just don't sync on the mail log. > Still, the cost of sync'ing a file cannot be that high. > I believe that this behavior suggests the presence of some other can > of worms somewhere, which somebody may like to open ;-) It really is that high. Syslogd writes to disk after every message (usually every line), so 13k/min is ~130 writes/s. When data is NOT synced, this means that it is not physically on disk. i.e. if the system crashes, the only data on disk will be since the last sync. (The kernel automatically syncs at regular intervals...every few minutes, IIRC) In other words, make sure kernel messages go to a file that gets synced, or you could be in for trouble. :) Have you (or anyone else) noticed syslogd crashing regularly? Mine crashes like every 2-3 days, and I have to restart it. -- Bob Bob McElrath (mcelrath@draal.physics.wisc.edu) Univ. of Wisconsin at Madison