getting error Too many open files in system
-
I am running a cron and output coming to my id and getting below as output: /bin/sh: /usr/bin/php: Too many open files in system Cron runs every 5 mins. Have checked /var/logs/cron and cron is executed every 5 mins. Sites are working fine on the server.
-
Answer:
This means your system ran out of file handles, either in your php or in another application. Make sure to http://php.net/fclose any files you open to free file handles. To the number of handles of every program running, use (as root): for p in $(ps -A -o pid); do nh=$(ls /proc/$p/fd 2>/dev/null | wc -l) && exe=$(readlink -f /proc/$p/exe 2>/dev/null) && echo "$p ($exe): $nh" done For a more verbose output, use lsof. You can also increase the number of possible system file handles by modyfing http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_limits.html (which effects changes to http://www.kernel.org/doc/Documentation/sysctl/fs.txt), and decrease it for the current terminal session with ulimit -n.
Alok at Server Fault Visit the source
Related Q & A:
- Why am I getting error unwrapping Optional if it has a value?Best solution by Stack Overflow
- Why am I getting error on page?Best solution by Yahoo! Answers
- How can I open files with the extension .ef?Best solution by solvusoft.com
- How to open files in PowerPoint or Microsoft Word?Best solution by computerhope.com
- How do I change .3gp video files to other video files, so I can open it up in Windows?Best solution by helpdeskgeek.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.