From owner-freebsd-current@FreeBSD.ORG Thu Jan 22 10:09:21 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC72E16A4CE for ; Thu, 22 Jan 2004 10:09:21 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id B21D043D2D for ; Thu, 22 Jan 2004 10:09:20 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i0MI9J3W045212; Thu, 22 Jan 2004 12:09:19 -0600 (CST) (envelope-from dan) Date: Thu, 22 Jan 2004 12:09:19 -0600 From: Dan Nelson To: Ian Freislich Message-ID: <20040122180918.GA94901@dan.emsphone.com> References: <98907.1074546817@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.5.1i cc: Poul-Henning Kamp cc: current@freebsd.org Subject: Re: Is BUFSIZ too small ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 18:09:22 -0000 In the last episode (Jan 22), Ian Freislich said: > "Poul-Henning Kamp" wrote: > > In message <200401192111.i0JLBYVk004060@apollo.backplane.com>, Matthew Dillon > > writes: > > >:I noticed that we still have BUFSIZ in stdio.h defined to only > > >:1024, and wonder if that should be increased these days. > > >: > > >:Is there anybody who could devise and run some benchmarks to find > > >:out what effect it would have to increase it to for instance > > >:4096? > > > > > > Very few programs use BUFSIZ for the actual I/O ops [...] > > > > I share many of your doubts, but I would still like to see some > > benchmarks :-) > > Perhaps ftp is one of those things that uses BUFSIZ for the actual > I/O ops. All of it's reads and writes if you truss it are 1024 bytes > which impacts its performance (here at least). Yeah, it's not so much stdio's use of BUFSIZ, it's other applications using it for their preferred I/O size. I upped the buffer size in ftpd locally because of this. There are a lot of references to BUFSIZ in the base system's code, but they're mainly just for reading in a config file, for example, or misused as sizing a filename buffer. ftpd and lpr jumped out as really wanting larger I/O sizes. -- Dan Nelson dnelson@allantgroup.com