Apache 2.4 Stops Serving Request - apache

This is something new, Apache is running fine as server on a Windows Server 2012. There is plenty of RAM and CPU and this is the only thing this server does, is an Apache server.
I can restart the service and it will run fine for a little bit then stop serving pages on all sites. I have messed with the worker threads to find a fine line but still having issues.
Currently settings in httpd-mpm.conf file
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 20
MaxRequestWorkers 250
MaxConnectionsPerChild 3000
</IfModule>
At this point I am not sure what is going on and have tried several suggestions from various websites.
Specs of Server: Windows 2012 R2 VM 2 GB of RAM 1 GB available Running on an SSD storage
This server connects to a MySQL database on the same network as well, there is not latency between the servers.

Related

Apache event MPM doesn't create new servers

I am running Apache 2.4.52 on x64 Amazon Linux 2 as a reverse-proxy onto a Java app. The only service running on the server is Apache. The server has 2GB RAM. My httpd.conf contains:
<IfModule mpm_event_module>
StartServers 3
ServerLimit 50
MaxRequestWorkers 1250
ThreadsPerChild 25
ThreadLimit 64
</IfModule>
The Java app backs off onto a 3rd-party REST API which sometimes experiences periods of high latency (> 60 seconds to respond). A few times now during one of these periods, Apache stops accepting new connections and needs to be restarted. There is nothing in the error_log to indicate what the issue is, nor anything in the server syslog. If I look at the server-status page, I can see only 3 filled slots, none of which are accepting new connections:
If I restart Apache, everything starts working again (albeit slowly due to the 3rd party API):
I'm confused why Apache doesn't create more servers/slots to handle the incoming traffic while the backend is responding slowly, nor why restarting makes the problem go away even if the backend is still responding slowly. I would have expected it to stop accepting traffic again after only a few minutes.
Can anyone shed some light on this please?

Maximum concurrent connections on Apache 2.2 running on Windows server 2008 r2 32-bit

The stress test I am running makes many connections to my Apache 2.2 running on Windows server 2008 r2 32-bit concurrently. Although my mpm_winnt_module configuration is:
<IfModule mpm_winnt_module>
ThreadsPerChild 1500
MaxRequestsPerChild 0</IfModule>
the maximum concurrent connections I can make is 600. I could not find anywhere in Apache 2.2.22 documentation mentioning this.
What is the deal with this? Has 32-bit got to do something with maximum concurrent connections?

Limit of 1010 reached when loadtesting Apache/PHP with Tsung

I've been testing an Ubuntu server A running Apache/PHP using Tsung from a server B and I reached something that looks like a limit, but I can't find any idea on what it might be : here is a graph showing the behavior => http://i.stack.imgur.com/Mspqp.png The value given as max by Tsung is 1010 which doesn't look like anything I know from Apache/PHP/MySQL/Ubuntu configuration.
Server A was a virtual machine at DigitalOcean, running a simple installation of Ubuntu 12.04 and Apache2/PHP5/APC (Perfork MaxClients 384, ServerLimit 500) : usage of CPU or RAM was OK, not full. Apache's server-status page also showed open slots so the limit doesn't seem to come from there.
Server B was another virtual machine at DigitalOcean running a simple installationg of Ubuntu 12.04 and Tsung.
Webapp code included some PHP and some MySQL requests (500 max connections).
I can't find any configuration value in Apache/PHP/Ubuntu that would explain a 1000 or 1010 limit, any ideas on where to look ?
Please update below parameters which would support up to 8000 simultaneous connections.
<IfModule mpm_worker_module>
ServerLimit 250
StartServers 10
MinSpareThreads 75
MaxSpareThreads 250
ThreadLimit 64
ThreadsPerChild 32
MaxClients 8000
MaxRequestsPerChild 10000
</IfModule>

cannot launch more than 1000 apache processes though maxclients and serverlimits is set to 3000

we have a very strong server (32-cores cpu, 96GB ram) and have apache running in prefork mode. our apache2.conf file includes such settings :
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 5
MaxSpareServers 20
ServerLimit 3000
MaxClients 3000
MaxRequestsPerChild 1000
</IfModule>
the problem is, when our website is under heavy load (when apache process count reaches 1000 to be precise) (or when setting StartServers beyond 1000), apache2 freezes and needs to be restarted. Yet there is still plenty of ram, cpu is underused and apache process count is far beyond maxclients.
My question is, what should i do to allow apache to reach the maxclients configured in the conf file ?
please consider we have already played with /etc/security/limits.conf to set max opened files and nprocs to 5000 (ulimit -a showed these values were well taken into account).
No errors are shown in /var/log/apache2/error.log
Your Apache server may have a compiled in hard limit. To change it you need to recompile your webserver. The default is 200000 which should be high enough - but packages from your linux distribution may differ.
I would rather recommend to get of static file serving from your webserver. Put an nginx or lighttp server in front of your apache. Let it serve static content (images, css, javascript, etc.) and forward dynamic request to your apache.

OSQA apache memory footprint

I have an OSQA (python / django q&a application) installation serving 8 different sites. The sites are all in development, receiving minimal traffic. The server is a virtual private server with 512 mb of ram.
Apache is only serving dynamic pages with mod_wsgi behind Nginx. I can't stop Apache consuming more and more memory with each request until the server chokes.
I experimented with the configuration parameters without much luck to minimize the memory footprint. With the following mpm_prefork parameters in apache2.conf:
StartServers 2
MinSpareServers 1
MaxSpareServers 4
MaxClients 4
MaxRequestsPerChild 100
2 apache processes start using 4 mb and after the first request there are 4 processes with each nearly 50 mb and with each new request those 4 processes climb steadily up to nearly 200 mb each.
I feel like there is something wrong going on. Any suggestions are greatly appreciated.
KeepAlive Off
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 3
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 2
WSGIDaemonProcess osqaWSGI processes=2 python-path=/web/osqa_server:/web/osqa_server/lib/python2.6 threads=1 maximum-requests=550
WSGIProcessGroup osqaWSGI
Ran httperf against this with 10,000 concurrent hits and it was still standing.