From owner-freebsd-stable@FreeBSD.ORG Mon Mar 26 09:16:17 2012 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 9BFFB106566C for ; Mon, 26 Mar 2012 09:16:17 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id 23E2B8FC21 for ; Mon, 26 Mar 2012 09:16:16 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [IPv6:2001:8b0:151:1:fa1e:dfff:feda:c0bb]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.5/8.14.5) with ESMTP id q2Q9G8gN094581 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 26 Mar 2012 10:16:08 +0100 (BST) (envelope-from matthew@FreeBSD.org) X-DKIM: OpenDKIM Filter v2.5.0 smtp.infracaninophile.co.uk q2Q9G8gN094581 Authentication-Results: smtp.infracaninophile.co.uk/q2Q9G8gN094581; dkim=none (no signature); dkim-adsp=none Message-ID: <4F7033CF.6000308@FreeBSD.org> Date: Mon, 26 Mar 2012 10:15:59 +0100 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120313 Thunderbird/11.0 MIME-Version: 1.0 To: freebsd-stable@FreeBSD.org References: <4F7019FC.4090907@ShaneWare.Biz> <4660483b96cf883fd66b46f4578d1def.squirrel@mail.digital-infotech.net> <20120326085640.GB5335@home.opsec.eu> In-Reply-To: <20120326085640.GB5335@home.opsec.eu> X-Enigmail-Version: 1.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig58A8A09048353A7D69848B96" X-Virus-Scanned: clamav-milter 0.97.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Cc: Subject: Re: Too many open files 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: Mon, 26 Mar 2012 09:16:17 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig58A8A09048353A7D69848B96 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 26/03/2012 09:56, Kurt Jaeger wrote: >>> From knowing that you have too many files open you can increase the >>> > > maxfile numbers - but if you want to know what uses them try this= - >>> > > >>> > > lsof -n | awk '{print $2 "\t" $1}' | sort | uniq -c | sort > On my system, it shows interesting numbers for firefox-instances: >=20 > 3895 4150 firefox-b > 4160 72958 firefox-b > 4240 3594 firefox-b > 4320 4232 firefox-b > 4431 89391 firefox-b >=20 > This seems to come from threads, where lsof shows the same > descriptor as open for multiple times, even if it comes from the > same process memory. >=20 > For example for pid 4232: >=20 > lsof -n | grep icon-theme.cache | grep 4232 | wc -l >=20 > firefox-b 4232 pi txt VREG 0,102 = 10784 924293 /usr/local/share/icons/hicolor/icon-theme.cache >=20 > This happens on 8.1-REL-p5 amd64. So the method is not fail-safe > for the real number of open files. >=20 Does 'procstat -fa' give better results for you? It seems to be one of those little hidden secrets that FreeBSD comes with a bunch of native applications that provide pretty much equivalent functionality to lsof(1). See: fstat(1), procstat(1), sockstat(1). Which is odd, given that since these sort of applications have to read and interpret kernel memory -- an action for which there isn't a nice well defined ABI -- the application has to be kept rigorously in synch with the kernel it is used against. Something that is intrinsically easier to do when kernel and application are compiled at the same time and from the same source tree. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey --------------enig58A8A09048353A7D69848B96 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9wM9gACgkQ8Mjk52CukIyKdgCghatb6YnDZqEyRZnKFQ9Fk9jJ iPIAn0Hu7ziAHoy5WIjVztQHDllRQ1TL =uVTP -----END PGP SIGNATURE----- --------------enig58A8A09048353A7D69848B96--