AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

前端 未结 6 1371
我寻月下人不归
我寻月下人不归 2021-02-05 05:36

I\'ve got a quite busy server: PHP (Wordpress) using W3TotalCache APC, Varnish for Apache and Cloudflare to handle all traffic. Ubuntu 14.04.4 LTS

Only one website with

相关标签:
6条回答
  • 2021-02-05 05:57

    Basically config got overwritten in: /etc/apache2/mods-available/mpm_prefork.conf

    I put the new setting in that file and it seems Apache works correctly now.

    Hopefully this helps someone else, don't put your config straight in apache2.conf or httpd.conf. Make sure you change all loaded config files.

    0 讨论(0)
  • 2021-02-05 05:59

    I also tried to increase MaxRequestWorkers on my server, and I was not seeing any effect. I realized what was going on when I ran "httpd" from the command line, it gave me this warning:

    AH00180: WARNING: MaxRequestWorkers of 512 exceeds ServerLimit value of
     256 servers, decreasing MaxRequestWorkers to 256.
     To increase, please see the ServerLimit directive.
    

    In your config, ServerLimit is still 256, so MaxRequestWorkers is capped by this value too.

    0 讨论(0)
  • 2021-02-05 06:05

    You may want to check your webserver access log. You may be the target of an xml-rpc attack in case the log is flooded with xml-rpc posts(e.g. "POST /xmlrpc.php HTTP/1.1" 200 403). There are various ways to prevent it from happening, but Wordpress is prone to this.

    0 讨论(0)
  • 2021-02-05 06:09

    In my case I couldn't find any solution, so I'm going to leave this answer here to help anyone else having this issue. In our case, increasing the MaxRequestWorkers didn't help.

    We had a server that had been working fine for one year at least. All of a sudden, it began to have issues to connect to https. In the apache error logs, we found a "Server reached MaxRequestWorkers" error, but the traffic was very slow (30 - 40 visitors active).

    After a deep look at logs and some research, I found that the issue was a Slowloris DoS attack.

    The attack is easy to mitigate. You could take a look at this post.

    0 讨论(0)
  • 2021-02-05 06:14

    you should edit mpm_prefork

    <IfModule mpm_prefork_module> StartServers 10 MinSpareServers 10 MaxSpareServers 20 ServerLimit 2000 MaxRequestWorkers 1500 MaxConnectionsPerChild 10000 </IfModule>

    0 讨论(0)
  • 2021-02-05 06:17

    You modified the wrong file. Your log says "mpm_prefork" error. So you need to modify mpm_prefork.conf rather than mpm_worker.conf.

    You can also use "apachectl -M" to see what module you are using. e.g. My apache2 is using mpm_event_module, so i need to modify mpm_event.conf

    $ apache2ctl -M
    Loaded Modules:
     core_module (static)
     so_module (static)
     watchdog_module (static)
     http_module (static)
     log_config_module (static)
     logio_module (static)
     version_module (static)
     unixd_module (static)
     access_compat_module (shared)
     alias_module (shared)
     auth_basic_module (shared)
     authn_core_module (shared)
     authn_file_module (shared)
     authz_core_module (shared)
     authz_host_module (shared)
     authz_user_module (shared)
     autoindex_module (shared)
     deflate_module (shared)
     dir_module (shared)
     env_module (shared)
     filter_module (shared)
     mime_module (shared)
     **mpm_event_module (shared)**
     negotiation_module (shared)
     setenvif_module (shared)
     status_module (shared)
     wsgi_module (shared)
    
    0 讨论(0)
提交回复
热议问题