<?php
$logpath='/var/log/apache2/error.log';
$pos=0;
if(is_file($logpath))
$pos=filesize($logpath);
$count=0;
$start=time();
while(true) {
system('/etc/init.d/apache2 reload');
$count++;
$fh=fopen($logpath,'r');
fseek($fh,$pos);
while(!feof($fh)) {
$line=fgets($fh);
if(strpos($line,'[error]')!==false) {
print $line;
print $count." reloads\n";
print (time()-$start)." seconds\n";
fclose($fh);
exit(0);
}
}
$pos=ftell($fh);
fclose($fh);
}
?>
I would look at /etc/security/limits.conf and /etc/security/limits.d and see if there is a special memory entry for the user httpd is running as. If there is you could change it but this just moves the point of failure. Have you opened a ticket with Red Hat? They may be able to find a the fix from a newer version of Apache and backport it.
As to how Apache 2.4 handles reloads it gracefully stops the existing instances and spawns new ones I have not done an exhaustive test of your problem but I handle about 200 virtual hosts on the central web server here at the University. I do reloads often and have not had the issue with Apache 2.4.
Darryl Baker
Sr. System Administrator
Northwestern | Information Technology
From: Michele Mase' [mailto:michele.mase@xxxxxxxxx
]
Sent: January 25, 2017 11:50 AM
To: Httpd Users List <users@xxxxxxxxxxxxxxxx>
Subject: Re: Unable to fork new process
I've tried with httpd.event, same result. Using a demo host with 260 vhosts, the httpd hangs after "only" 1000 reloads. The relationship seems to be the following:
number of virtualhosts = x/number of reloads10 virtualhosts = 100000 reloads
100 virtualhosts = 1000 reloads
Tomorrow I 'll try to test httpd 2.4.x.
Other better ideas?
Regards
On Wed, Jan 25, 2017 at 4:42 PM, Darryl Philip Baker <darryl.baker@xxxxxxxxxxxxxxxx
> wrote: The Red Hat software collection are Red Hat rpms they are just in a non-default repository. The have all the same support from Red Hat as the defaults. I’ve included a link to the latest version but Apache 2.4 has been in there since the very first release.
Darryl Baker
NIT - CI -DAPS
X76674
From: Michele Mase' [mailto:michele.mase@xxxxxxxxx
]
Sent: January 25, 2017 8:59 AM
To: Httpd Users List <users@xxxxxxxxxxxxxxxx>
Subject: Re: Unable to fork new process
Due to redhat subscription, we must use redhat's rpms. Now I'm trying the php loop against another web server. Then I will try with apache 2.4.x in a offline env. My question is the same:
After xx reloads under yy load average in zz time the error will appears "every time".
Any smarter suggestion?