LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   "file descriptors" problem on RedHat 7 (https://www.linuxquestions.org/questions/red-hat-31/file-descriptors-problem-on-redhat-7-a-4175585754/)

julian16 07-28-2016 06:39 PM

"file descriptors" problem on RedHat 7
 
I got an interesting case on our RedHat 7 system: often the apache web server fails on its CGI processes with errors like:

AH01215: Error in tempfile() using template /tmp/XXXXXXXXXX:
Could not create temp file /tmp/89R0x3Dl7D

(“drwxrwxrwt. 7 root root 4096 Jul 28 13:02 /tmp”)

With hints from Googling the error I “bring it back” by restart the Apache web server (then apache/CGI resumes normal work). The problem is that I have to restart the apache so often.

The output from “lsof | wc –l” shows it has 19107. This number seems too high? (on my other servers this is like 550 and 3620 respectively. I don’t know much about “file descriptors” and wonder is there anything unusual on the system that I should correct before looking at the options to increase the upper limits?

linosaurusroot 07-29-2016 02:04 AM

Are you using fastcgi? Your CGIs probably need to be better at closing their files, and exiting.

julian16 07-29-2016 12:14 PM

That's a good thought. We do have many perl/CGI (not fast CGI). However there may be odds but to close file HANDLES and to "exit 0" at the end of each script is our standard practice. The same set of CGI scripts work fine for years, and still working fine, on our old server (RedHat 6; We are migrating to the new server with RedHat 7).

Any hint to further diagnose/correct would be appreciated.

j

julian16 07-29-2016 12:30 PM

Dumb on me. Just tried a

awk '{print $1}' lsof.output | awk 'FS="/"{print $1}' | sort | uniq -c"

and found the trouble maker that creates tons of open files. Will pursue that direction.

j

onebuck 07-29-2016 03:32 PM

Moderator response
 
Moved: This thread is more suitable in <Red Hat> and has been moved accordingly to help your thread/question get the exposure it deserves.


All times are GMT -5. The time now is 08:26 PM.