From owner-freebsd-hackers Wed Feb 10 13:30:51 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA21777 for freebsd-hackers-outgoing; Wed, 10 Feb 1999 13:30:51 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from iquest3.iquest.net (iquest3.iquest.net [209.43.20.203]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id NAA21771 for ; Wed, 10 Feb 1999 13:30:50 -0800 (PST) (envelope-from toor@y.dyson.net) Received: (qmail 27619 invoked from network); 10 Feb 1999 21:30:41 -0000 Received: from dyson.iquest.net (HELO y.dyson.net) (198.70.144.127) by iquest3.iquest.net with SMTP; 10 Feb 1999 21:30:41 -0000 Received: (from root@localhost) by y.dyson.net (8.9.1/8.9.1) id QAA02531; Wed, 10 Feb 1999 16:30:39 -0500 (EST) Message-Id: <199902102130.QAA02531@y.dyson.net> Subject: Re: PIPE_BUF In-Reply-To: from Tony Finch at "Feb 10, 99 06:14:08 pm" To: dot@dotat.at (Tony Finch) Date: Wed, 10 Feb 1999 16:30:39 -0500 (EST) Cc: hackers@FreeBSD.ORG From: "John S. Dyson" Reply-To: dyson@iquest.net X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Tony Finch said: > I've been looking at the Apache code for doing buffered writes to > logs, which it attempts to do in such a way that log records are not > split across buffer boundaries. It therefore buffers up to PIPE_BUF > bytes to be written in one go. > > Unfortunately, on FreeBSD this doesn't win us much because our log > format averages over 200 bytes and PIPE_BUF is only 512 bytes, so > we'll only be writing at most a couple of records at a time. Other > systems have PIPE_BUF sizes like 4K (Linux), 5K (Solaris), and 10K > (IRIX). > > What do I need to worry about if I rebuild the system with a bigger > PIPE_BUF? > > (Actually, I don't really care about the buffer boundary thing so if > changing PIPE_BUF is painful I'll just compile Apache to use a bigger > buffer regardless of PIPE_BUF.) > You can probably get by with compiling with PIPE_BUF being a small multiple of PAGE_SIZE. A good system wide compromise might be to set PIPE_BUF to such a small multiple, and modifying stdio to flush pipes with a smaller buffer size that that. That will help the interactive pipe issue, and improve those processes that go out of their way to maximize performance or produce contiguous messages. Make sure that your PIPE_BUF size doesn't conflict with other manifest constants in the pipe header file. -- John | Never try to teach a pig to sing, dyson@iquest.net | it makes one look stupid jdyson@nc.com | and it irritates the pig. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message