From owner-freebsd-stable@FreeBSD.ORG Mon Mar 26 08:47:40 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 E89C9106566B for ; Mon, 26 Mar 2012 08:47:40 +0000 (UTC) (envelope-from prabhpal@digital-infotech.net) Received: from mail.digital-infotech.net (mail.digital-infotech.net [41.211.25.193]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE1A8FC08 for ; Mon, 26 Mar 2012 08:47:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.digital-infotech.net (Postfix) with ESMTP id E0FA52E402A; Mon, 26 Mar 2012 08:55:17 +0000 (GMT) Received: from mail.digital-infotech.net ([127.0.0.1]) by localhost (mail.digital-infotech.net [127.0.0.1]) (maiad, port 10024) with ESMTP id 06004-07; Mon, 26 Mar 2012 08:55:14 +0000 (GMT) Received: from mail.digital-infotech.net (localhost [127.0.0.1]) by mail.digital-infotech.net (Postfix) with ESMTP id 3FA2B2E4028; Mon, 26 Mar 2012 08:55:14 +0000 (GMT) Received: from 41.211.28.2 (SquirrelMail authenticated user prabhpal@digital-infotech.net) by mail.digital-infotech.net with HTTP; Mon, 26 Mar 2012 08:55:14 -0000 Message-ID: <4660483b96cf883fd66b46f4578d1def.squirrel@mail.digital-infotech.net> In-Reply-To: <4F7019FC.4090907@ShaneWare.Biz> References: <4F7019FC.4090907@ShaneWare.Biz> Date: Mon, 26 Mar 2012 08:55:14 -0000 From: "Prabhpal S. Mavi" To: "Shane Ambler" User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: freebsd-stable@freebsd.org, prabhpal@digital-infotech.net, "C. P. Ghost" Subject: Re: Too many open files X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: prabhpal@digital-infotech.net 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 08:47:41 -0000 Hello Shane, thanks for your valuable response, this is brilliant. this is what i was exactly looking for. very good command indeed. Grateful for your kind assistance Thanks / Regards > On 26/03/2012 02:19, C. P. Ghost wrote: >> On Sun, Mar 25, 2012 at 6:46 PM, Prabhpal S. Mavi >> wrote: >>> Greetings Friends, >>> >>> have anyone has come across this warning / error? This occurs when i >>> ssh >>> to my FreeBSD 9.0 System. any help would be greatly appreciated. >>> >>> Warning: >>> /usr/share/games/fortune/freebsd-tips.dat: Too many open files in >>> system >>> [mavi@titan ~]$ su >>> su: pam_start: system error >>> >>> Thanks / Regards >>> Prabhpal >> >> What does this command say on your system? >> >> % sysctl kern.maxfiles kern.maxfilesperproc kern.openfiles >> >> You may have exceeded the maximum number of open files >> in the system. Maybe some ill-conceived program that doesn't >> close non-needed connections, files, etc is at fault? It's easy >> to open more and more files, and to gradually fill the open >> files descriptor table in the kernel this way. >> >> -cpghost. >> > > 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 > > lsof outputs open file info, awk then gives us the PID and proc name > which gets sorted and uniq gives a count of each which we sort to have > the largest file count at the bottom of the list. What you end up with > is a list of two numbers and a name - count of files open followed by > the PID and proc name that has them open. > > The catch is that it also includes network connections (I know how to > list only network but not sure how to exclude them) > > ps ax | grep PID > > will show you the full program name if it has been shortened. > > lsof -p PID > > will show all the open files for PID > > Not sure if this is the best way but it works for me. > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" >