logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.4.2X restarting/crashing Win2012 Srv
Author
simond5



Joined: 25 Nov 2017
Posts: 2
Location: UK

PostPosted: Mon 27 Nov '17 12:59    Post subject: Apache 2.4.2X restarting/crashing Win2012 Srv Reply with quote

I have a group of customers running Apache 2.4.25, 2.4.27 and 2.4.29 x64 (All WAMP installs) , and they ALL have issues with Apache HTTPD service crashing and restarting on Windows 2012 Srv. The Windows Event log usually shows faulting app HTTPD , faulting module NTDLL.DLL. We are running various versions of PHP (mostly 7). This crashing of Apache is a serious problem and with one customer it is happening every 1-2 hours, causing all screens to go dark as they are running our dashboard. It is happening everywhere on many computers in our lab , and the Windows event log gives no clues as to why, nor does the Apache logs. What can I do here ? This is a major problem, I switched a client to FastCGI and that seems better now , we are a heavy PHP application. I noticed that other people have posted similar issues. This never happened with much earlier versions of PHP and Apache only v 2.4.X it seems.. Apache Error logs just report Any help appreciated
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Mon 27 Nov '17 13:10    Post subject: Reply with quote

I assume you tried.

AcceptFilter http none
AcceptFilter https none
EnableSendfile off
EnableMMAP off

Maybe a third-party extension is causing troubles.

To prevent crashing, running FastCGI is always advised.


Running as Fastcgi memory usage of Apache is far less en the Speed is on par when running as module. There are advantages to running PHP with FCGI. Separating the PHP code from the web server removes 'bloat' from the main server, and improves the performance of non-PHP requests. Secondly, having one permanent PHP process as opposed to one per apache process means that shared resources like persistent MySQL connections are used more efficiently. And maybe even more important is stability, since I run FCGI my server never crashed caused by php (extension) errors and out of memory errors.
Back to top
simond5



Joined: 25 Nov 2017
Posts: 2
Location: UK

PostPosted: Mon 27 Nov '17 16:15    Post subject: Httpd crashing in win2012 Srv Reply with quote

Steffen , thanks for taking the time to answer, yep indeed those are all set (in fact the latest WAMP install has all those pre config'd). The one customer using FastCGI is seeing a slightly worse situation now where the VM Windows is dying completely , cant even RDP to it , i did see a 'run out of threads' error late last week in apache_error , and so I am going to up the number this week. Also increased the MaxProcesses in FCGI config as well - config looks like this now -

Code:
<IfModule fcgid_module>
 FcgidInitialEnv PATH "C:/Wamp/bin/php/php7.1.9;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
 FcgidInitialEnv SystemRoot "C:/Windows"
 FcgidInitialEnv SystemDrive "C:"
 FcgidInitialEnv TEMP "C:/Wamp/tmp"
 FcgidInitialEnv TMP "C:/Wamp/tmp"
 FcgidInitialEnv windir "C:/WINDOWS"
 FcgidIOTimeout 64
 FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 1500
FcgidMaxProcesses 45
FcgidMaxRequestLen 588131072
# FcgidThreadsPerChild        64
 # Location php.ini:
 FcgidInitialEnv PHPRC "C:/Wamp/bin/apache/apache2.4.29/bin"
 FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1500
 
 <Files ~ "\.php$">
        Options Indexes FollowSymLinks ExecCGI
        AddHandler fcgid-script .php
        FcgidWrapper "C:/Wamp/bin/php/php7.1.9/php-cgi.exe" .php
    </Files>
 </IfModule>


Should I be editing the mod_mpm as well ? Here are the current settings, but i am not sure which needs to change or what needs to be added if anything

Code:
<IfModule mpm_prefork_module>
    StartServers             5
    MinSpareServers          5
    MaxSpareServers         10
    MaxRequestWorkers      250
    MaxConnectionsPerChild   0
</IfModule>

<IfModule mpm_worker_module>
    StartServers             3
    MinSpareThreads         75
    MaxSpareThreads        250
    ThreadsPerChild         25
    MaxRequestWorkers      400
    MaxConnectionsPerChild   0
</IfModule>

<IfModule mpm_winnt_module>
    ThreadsPerChild        150
    MaxConnectionsPerChild   0
</IfModule>
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Mon 27 Nov '17 16:51    Post subject: Reply with quote

Seems ThreadsPerChild is a bit low.

Here we have it 256 in <IfModule mpm_winnt_module>

With mod_status you can verify the number of workers are occupied.


I am using also MRTG to follow the busyworkers, see https://www.apachelounge.com/viewtopic.php?p=20147
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 05 Dec '17 0:14    Post subject: Reply with quote

Even with fcgid I had some issues running the NTS version of php. it sometimes crashed my apache. Running fcgid with the TS version was the solution. It isn't noticalbe slower like some ppl say.
Back to top


Reply to topic   Topic: Apache 2.4.2X restarting/crashing Win2012 Srv View previous topic :: View next topic
Post new topic   Forum Index -> Apache