From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 9 20:40:17 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46033106566B for ; Thu, 9 Dec 2010 20:40:17 +0000 (UTC) (envelope-from chuckr@telenix.org) Received: from mail5.sea5.speakeasy.net (mail5.sea5.speakeasy.net [69.17.117.49]) by mx1.freebsd.org (Postfix) with ESMTP id 2203C8FC19 for ; Thu, 9 Dec 2010 20:40:16 +0000 (UTC) Received: (qmail 13065 invoked from network); 9 Dec 2010 20:40:16 -0000 Received: from april.chuckr.org (HELO april.telenix.org) (chuckr@[66.92.151.30]) (envelope-sender ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 9 Dec 2010 20:40:16 -0000 Message-ID: <4D013EB2.5040101@telenix.org> Date: Thu, 09 Dec 2010 15:40:18 -0500 From: Chuck Robey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100907 Thunderbird/3.1.2 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4D000448.1050606@telenix.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: getting a list of open files versus PID nos.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 20:40:17 -0000 On 12/08/10 17:54, Matthew Fleming wrote: > On Wed, Dec 8, 2010 at 2:18 PM, Chuck Robey wrote: >> I think, *maybe* that I have located what's been giving me all of those >> machine lockups. I was all ready to replace the mobo& cpu when I noticed a >> panic error of being out of open files. The message suggested just adding >> the ability for more open files, but if it's what I think it is, that would >> only mean it would take longer to panic, but it would still be tossing >> panics at me. >> >> What I want to see is a list of all Pids and how many open files there are >> associated with each Pid? And maybe a "ps ax" list, so I can associate an >> application with a pid. I would set things up so it would do this every 15 >> minutes, and it might just point me at my real problem here. >> >> Any idea what would be the best way to get a list of all openfiles versus >> each open pid? I would be happy to write up a python script to give me >> application versus count of open files list, if I could start with that >> files versus pids thing. > > This is what lsof is for. I believe there's one in ports, but I have > never tried it. lsof was perfect, I couldn't remember that app-name, but it turned out I'd already had a copy built. There were 3 candidates for having the most files open: procname Number of open files ======== ==================== firefox 426 thunderbird 1342 enlightenment 2643 Are all of these excessive, or only one of them? Any notion, or any known problem with any of these tree applications? I'm perfectly willing to go on this by any vagrant memories you have hanging about.