Date: Mon, 26 Mar 2012 08:55:14 -0000 From: "Prabhpal S. Mavi" <prabhpal@digital-infotech.net> To: "Shane Ambler" <FreeBSD@ShaneWare.Biz> Cc: freebsd-stable@freebsd.org, prabhpal@digital-infotech.net, "C. P. Ghost" <cpghost@cordula.ws> Subject: Re: Too many open files Message-ID: <4660483b96cf883fd66b46f4578d1def.squirrel@mail.digital-infotech.net> In-Reply-To: <4F7019FC.4090907@ShaneWare.Biz> References: <a8f31306b066f86beabc61fce1e2b5fb.squirrel@mail.digital-infotech.net> <CADGWnjWTNviAyfReZ-fy0rhF=DKsA57rCscYtsU=v25rTMq5Xw@mail.gmail.com> <4F7019FC.4090907@ShaneWare.Biz>
next in thread | previous in thread | raw e-mail | index | archive | help
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 >> <prabhpal@digital-infotech.net> 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" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4660483b96cf883fd66b46f4578d1def.squirrel>