<?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.ba...@northwestern.edu> 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.m...@gmail.com]
> *Sent:* January 25, 2017 11:50 AM
> *To:* Httpd Users List <users@httpd.apache.org>
> *Subject:* Re: [users@httpd] 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.ba...@northwestern.edu> 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
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.redhat.com_en_about_press-2Dreleases_red-2Dhat-2Dsoftware-2Dcollections-2D23-2Dand-2Dred-2Dhat-2Ddeveloper-2Dtoolset-2D6-2Dnow-2Dgenerally-2Davailable&d=CwMFaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=tdje61_VHSXp608oLofeaJnnzo2Sr9_Cdcp70bBEtQ8&m=POnf8iSgk-7Y5sDIvZay4HMtxJuPXaV2aPvP6CGf32Q&s=UwHKp55lJ5QwqSmAcLj2eCJS9G9QIjWSOxvn9k4hUZM&e=>
>
>
>
> Darryl Baker
>
> NIT - CI -DAPS
>
> X76674
>
>
>
> *From:* Michele Mase' [mailto:michele.m...@gmail.com]
> *Sent:* January 25, 2017 8:59 AM
> *To:* Httpd Users List <users@httpd.apache.org>
> *Subject:* Re: [users@httpd] Unable to fork new process
>
>
>
>
>
> On Wed, Jan 25, 2017 at 3:39 PM, Darryl Philip Baker <
> darryl.ba...@northwestern.edu> 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?
>
>
>

Reply via email to