Question: Apache keeps going down on a Plesk server: server reached MaxRequestWorkers setting
Applicable to:
Symptoms- Websites on the server are experiencing 504 Gateway Time-out nginx error consistently after working without issues for a period of time.
- The Apache web server goes down periodically with the following error message in Apache error log:
- on CentOS/RHEL-based distributions: /var/log/httpd/error_log
- on Debian/Ubuntu-based distributions: /var/log/apache2/error.log
AH00484: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers settingserver is within MinSpareThreads of MaxRequestWorkers, consider raising the MaxRequestWorkers setting
- The following error message is logged in domain's log at Plesk > Domains > Logs:
[error] 26927#0: *417 connect() failed (110: Connection timed out) while connecting to upstream, client: 203.0.113.2, server: example.com, request: "GET /?amp HTTP/1.1", upstream: "https://203.0.113.2/?amp", host: "example.com"- Requests are being served slowly or not served at all, and therefore, the websites become inaccessible, even though the server's CPU and RAM resources are not exhausted.
CauseThe server is receiving a large number of requests, which is causing the Apache web server to reach its MaxRequestWorkers limit. A large number of requests may be caused by an increase in website visitors or a DDoS attack.
Resolution1.Ensure the server isn't under attack. You can use this article to do this:
How to diagnose a DoS/DDoS attack and find websites under attack on a Plesk server
2.If an attack has been detected, it is necessary to take measures to protect the server from attacks as described in this article: What DDoS protection tools are available in Plesk
If no attacks are detected, proceed to the next step.
3.You need to monitor the server using this article: How to monitor usage of system resources in a period of time using atop
- If the CPU and memory load are not high <60%, you can increase the parameter MaxRequestWorkers using this article: How to calculate and adjust the MaxRequestWorkers limit on the server with Plesk.
You have a reserve of resources up to 80% load.
- If the server's processor or memory is loaded at 80% or more, it's necessary to increase the number of processor cores or the amount of RAM on the server, depending on which resource is overloaded.
Once the server resources have been expanded, you can begin to increase the parameter MaxRequestWorkers so that the server can handle more requests. To calculate the MaxRequestWorkers Use this article: How to calculate and adjust the MaxRequestWorkers limit on the server with Plesk
Note: Increasing the limit MaxRequestWorkers should only be done after a full investigation of the server using the articles provided above.