From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 24 19:30:26 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4831B16A4D1; Mon, 24 Jan 2005 19:30:26 +0000 (GMT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 82B8843D41; Mon, 24 Jan 2005 19:30:21 +0000 (GMT) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 24 Jan 2005 19:30:20 +0000 (GMT) Date: Mon, 24 Jan 2005 19:30:20 +0000 From: David Malone To: at Message-ID: <20050124193020.GA40845@walton.maths.tcd.ie> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i Sender: dwmalone@maths.tcd.ie cc: freebsd-hackers@freebsd.org Subject: Re: syslogd pipelines losing messages X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2005 19:30:26 -0000 On Mon, Jan 24, 2005 at 10:39:23AM -0500, Felix Hernandez-Campos wrote: > Anyway, I think I did all the homework, and I just need someone to > suggest an elegant solution rather than my usleep (is there a > yield-type syscall?). I'm more than willing to try out your ideas in > our environment and prepare the patch when something good comes up. I'd guess that the pipe is filling, as there is only so much that you can write to a pipe before it fills. So, as you say, the usleep is giving a chance for the reader to clear the pipe. I guess that syslogd may be reading a big chunk of messages and writing them all at once, without a pause. I have a feeling that it won't help, but it would be useful if you could install the buffer program from ports and add it to your pipeline, something like: local0.* | exec buffer | grep -v DUPLEX_MISMATCH >> /usr/home2/wap_syslog_local0 to see if it helps. I suspect it won't and it might be necessary to either yeild or to use aio or something. You could try using sched_yield() to give the other process a chance. David.