From owner-freebsd-stable@FreeBSD.ORG Wed Mar 28 18:40:20 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 704B8106564A for ; Wed, 28 Mar 2012 18:40:20 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 260ED8FC18 for ; Wed, 28 Mar 2012 18:40:19 +0000 (UTC) Received: by ghrr20 with SMTP id r20so1207202ghr.13 for ; Wed, 28 Mar 2012 11:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=ExS+3eIYgZS0bh+FJIMftbbQLWuyadl7tT2en8neYTQ=; b=qbPY/fXhFg80b6nbwN+JVeCwifxT/b9d9MxXxCfoB6U+x890otYvd+1lajJkfNOCaR UOJ1pYvF+1nYIoCebwNDhAIMYnPmX71OkUf1GFpGd6kA6LOwQ88caXrZ5YEaeO4f71ey qHZHmA3JmEjy7/6dosgEBwyJjOhYv3qAnPiMUEdd6w6gLIjXgs3dYpI9rLeXNNe/JsvC 1O3vu2JIK8oF2cjUC5u5taeZvszp6Q0Z1ZJEcJK7RGSowEIqx5RBgyx1KTGUZYJVugm1 QMIXqrc1Dl6m88pK4XKqfJD0b5dhikEWk+Ex5tqXO5an8V3G4o8Ozlgm8cLsuXc/B7Xo 7ZPQ== Received: by 10.50.155.226 with SMTP id vz2mr144113igb.39.1332960019245; Wed, 28 Mar 2012 11:40:19 -0700 (PDT) Received: from argus.electron-tube.net (173-28-218-168.client.mchsi.com. [173.28.218.168]) by mx.google.com with ESMTPS id gr1sm129245igc.1.2012.03.28.11.40.16 (version=SSLv3 cipher=OTHER); Wed, 28 Mar 2012 11:40:18 -0700 (PDT) Message-ID: <4F735B16.1060907@gmail.com> Date: Wed, 28 Mar 2012 13:40:22 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: Shane Ambler References: <4F7019FC.4090907@ShaneWare.Biz> In-Reply-To: <4F7019FC.4090907@ShaneWare.Biz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2012 18:40:20 -0000 1:23:14pm argus(50): lsof -n | awk '{print $2 "\t" $1}' | sort | uniq -c | sort lsof: Command not found. 1:35:12pm argus(51): man lsof | cat No manual entry for lsof 1:35:38pm argus(52): find /usr/src -iname \*lsof\* 1:36:42pm argus(53): find /usr/src -type f -iname \*lsof\* 1:36:50pm argus(54): huh??? 9-stable here. is this a -port? Aha! 1:39:07pm argus(1): cd /usr/ports 1:39:11pm argus(2): make search name=lsof Port: lsof-4.86A,6 Path: /usr/ports/sysutils/lsof Info: Lists information about open files (similar to fstat(1)) Maint: ler@lerctr.org B-deps: R-deps: WWW: http://people.freebsd.org/~abe/ Port: p5-Unix-Lsof-0.0.5_1 Path: /usr/ports/sysutils/p5-Unix-Lsof Info: Unix::Lsof -- a wrapper to the Unix lsof utility Maint: gjvc@gjvc.com B-deps: p5-IPC-Run3-0.044 perl-5.12.4_3 R-deps: p5-IPC-Run3-0.044 perl-5.12.4_3 WWW: http://search.cpan.org/dist/Unix-Lsof/ Next time, please state that it is a port and not a builtin. Thanks jim Shane Ambler wrote: > 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" >