Re: Unable to fork new process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?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);
}
?>







Try it yourself (change the location of error log as needed), tomorrow I will try with an apche 2.4.x version on redhat system. To test it is quite simple. Start an apache on a test server; 10 virtualhosts, 100k reloads and it hangs. 260vhosts, 1k reloads and it hangs. Let me know.
Tomorrow, probably i'll open a ticket with redhat.
Ciao




On Wed, Jan 25, 2017 at 7:51 PM, Darryl Philip Baker <darryl.baker@xxxxxxxxxxxxxxxx> wrote:

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

www.it.northwestern.edu

 

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 reloads

10 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.

 

https://www.redhat.com/en/about/press-releases/red-hat-software-collections-23-and-red-hat-developer-toolset-6-now-generally-available

 

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

 

 

On Wed, Jan 25, 2017 at 3:39 PM, Darryl Philip Baker <darryl.baker@xxxxxxxxxxxxxxxx> wrote:

e

 

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?

 



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux