• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Perl Error: Too many open files

C

centsi

Guest
I've been running this server for a year and all of a sudden all of the perl scripts are generating this error in the log file:

[Fri Mar 10 08:07:56 2006] [error] [client 216.18.50.182] (24)Too many open files: couldn't set child process attributes: /home/httpd/vhosts/.../cgi-bin/formmail.pl, referer: http://www.domain.com/quote.html
[Fri Mar 10 08:07:56 2006] [error] [client 216.18.50.182] (24)Too many open files: couldn't spawn child process: /home/httpd/vhosts/.../cgi-bin/formmail.pl, referer: http://www.domain.com/quote.html

These scripts are counters and forms. The don't give an internal server error, they just don't show anything. I have many sites accessing 1 single script for simplicity. Like I said, it worked just fine for a year until a week ago. Running psa v7.5.3_build75050509.16 os_FedoraCore 2. Thanks!
 
Update

I updated PSA to 7.5.4 from 7.5.3 and everything worked for about 10 minutes. Then it all crashed again and I'm getting the same perl errors. Does anyone have an idea about this? My server is crippled until I can fix it.
 
More than likely something is leaking file handles within Apache. The per process limit is 1024 open files by default, the overall system limit with Linux 2.6 will dynamically grow (prior <2.6 kernels had to be tuned).

You may want to adjust your MaxRequestsPerChild down to something like 500 until you fix the problem with the script. I think by default it is 4K with Apache.

Does any of your clients use mod_perl, btw?
 
You are correct. That is the issue. I don't really know to recomplie Apache to fix it though. Any ideas?
 
Recompiling Apache is not necessary, just edit /etc/httpd/conf/httpd.conf and find the MaxRequestsPerChild parameter and adjust it (this is a band-aid) OR identify the script that is causing the issue and fix it.
 
Back
Top