From owner-freebsd-current@FreeBSD.ORG Fri Apr 23 17:12:52 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 2FC8916A4CE for ; Fri, 23 Apr 2004 17:12:52 -0700 (PDT) Received: from mail002.syd.optusnet.com.au (mail002.syd.optusnet.com.au [211.29.132.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id E43FC43D1D for ; Fri, 23 Apr 2004 17:12:50 -0700 (PDT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) i3O0ChM22426; Sat, 24 Apr 2004 10:12:44 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])i3O0CcSU043731; Sat, 24 Apr 2004 10:12:43 +1000 (EST) (envelope-from jeremyp@cirb503493.alcatel.com.au) Received: (from jeremyp@localhost)i3O0CV8M043730; Sat, 24 Apr 2004 10:12:31 +1000 (EST) (envelope-from jeremyp) Date: Sat, 24 Apr 2004 10:12:31 +1000 From: Peter Jeremy To: Eric Anderson Message-ID: <20040424001231.GH53327@cirb503493.alcatel.com.au> References: <40867A5D.9010600@centtech.com> <40887100.3040606@kientzle.com> <408919BA.5070702@centtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <408919BA.5070702@centtech.com> User-Agent: Mutt/1.4.2i cc: freebsd-current@freebsd.org Subject: Re: Directories with 2million files 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: Sat, 24 Apr 2004 00:12:52 -0000 On Fri, Apr 23, 2004 at 08:27:22AM -0500, Eric Anderson wrote: >Resource limits (current): > datasize 524288 kb > >Ouch! That seems pretty low to me. 1gb would be closer to reasonable >if you ask me, but I'm nobody, so take it with a grain of salt. Why do you feel this is low? The intent of this limit is to stop a runaway process eating all of RAM and swap. It is probably reasonable as a default for a workstation (X, KDE, Mozilla & OpenOffice are each unlikely to exceed 512MB during normal use) or server. People with atypical requirements will need to do some tuning. I agree that the defaults mean you can't run 'ls' on a directory with 2e6 files but this isn't a typical requirement. Upping the default limit to 1GB increases the risk that a runaway process will make the machine unusable (think how your machine with 768MB RAM would behave if you increased datasize to 1GB and tried to run ls on a directory with just under 4e6 files). As for ls(1), its theoretical memory requirements are of the order of 32 bytes per entry plus the size of the directory in order to run 'ls -lsio'. It should be reasonably easy to remove the need to store anything if you don't require sorting or column alignment but beyond that, the code complexity starts to increase significantly. -- Peter Jeremy