From owner-freebsd-stable@FreeBSD.ORG Sat Sep 27 21:46:32 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4371065688; Sat, 27 Sep 2008 21:46:32 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id BEE828FC08; Sat, 27 Sep 2008 21:46:31 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c122-106-215-175.belrs3.nsw.optusnet.com.au [122.106.215.175]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m8RLkSOY001942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 28 Sep 2008 07:46:29 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.2) with ESMTP id m8RLkRnV010959; Sun, 28 Sep 2008 07:46:27 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m8RLkR2O010936; Sun, 28 Sep 2008 07:46:27 +1000 (EST) (envelope-from peter) Date: Sun, 28 Sep 2008 07:46:27 +1000 From: Peter Jeremy To: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <20080927214627.GQ15376@server.vk2pj.dyndns.org> References: <98425339-23F8-4A90-8CF1-2E85DD82D857@ish.com.au> <20080927030204.GB40195@icarus.home.lan> <48DE9411.8010002@quip.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="46ylB6ruXBJsCJK+" Content-Disposition: inline In-Reply-To: <48DE9411.8010002@quip.cz> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Jeremy Chadwick , freebsd-stable Stable Subject: Re: sysctl maxfiles X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 21:46:32 -0000 --46ylB6ruXBJsCJK+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2008-Sep-27 22:14:09 +0200, Miroslav Lachman <000.fbsd@quip.cz> wrote: >root@roxy ~/# fstat -u www | wc -l > 9931 >root@roxy ~/# fstat -u root | wc -l > 718 >root@roxy ~/# fstat | grep httpd | wc -l > 6379 >root@roxy ~/# fstat | grep httpd | wc -l > 6002 >root@roxy ~/# fstat -u www | wc -l > 4691 >root@roxy ~/# sysctl kern.openfiles >kern.openfiles: 846 kern.openfiles reflects the total number of open file structures within the kernel, whereas fstat (and lsof) report both open files and vnodes associated with each process. The differences are 1) File structures are shared via fork() etc so the same file structure can be reported multiple times. 2) fstat reports executable name, working directory and root Open files in fstat can be detected because they have numeric values (possibly with a '*' appended) in the FD column. Unfortunately, there doesn't appear to be any easy way to detect shared file structures (for inode-based files) using either fstat or lsof. In the case of apache, there are at least 6 file structures shared by each httpd process (and it looks like it might be about 15). --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --46ylB6ruXBJsCJK+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEUEARECAAYFAkjeqbMACgkQ/opHv/APuIcg7gCVEDqu6jwZ0iXUXf6zFBbfK4rU AwCeI556Q8RLq7N+4qhEbf/+2J4E3Nk= =489V -----END PGP SIGNATURE----- --46ylB6ruXBJsCJK+--