Skip to main content

Server is within MinSpareThreads of MaxRequestWorkers, consider raising the MaxRequestWorkers setting

Comments

11 comments

  • kodeslogic
    You will have to raise the Max Request Workers in the Apache configuration. You can also consult certified
    1
  • ksgalicia
    These are the default values of the Apache configuration:
    • Start Servers: 5
    • Minimum Spare Servers: 5
    • Maximum Spare Servers: 5
    • Server Limit: 256
    • Max Request Workers: 150
    • Max Connections Per Child: 100000
    • Keep-Alive: On
    • Keep-Alive Timeout: 5
    • Max Keep-Alive Requests: 100
    • Timeout: 300
    What are the recommended values or is there a tool to calculate the recommended values according to the VPS server processor and memory? Thanks!
    0
  • cPRex Jurassic Moderator
    There are no tools that will accurately give you the settings based on the server's hardware, as it also depends on the site content and traffic as well. You can increase the MaxRequestWorkers value to 200 to see if that keeps you from getting these warnings in the log.
    0
  • ksgalicia
    I understand that if I have to increase the value of MaxRequestWorkers to 200 then I have to proportionally increase the value of the other parameter ServerLimit more or less to 340, correct?
    0
  • kodeslogic
    You need to keep MaxRequestWorkers value less than the value set for ServerLimit. So you if you're planning to raise the MaxRequestWorkers value greater than the current ServerLimit then you should also adjust the ServerLimit value to be greater than MaxRequestWorkers whatever you set.
    0
  • ksgalicia
    Hi! I keep having problems with Apache. It stays locked and reboot to unlock. Attachment screenshot. As you can see there are 100 requests currently being processed, 100 idle workers. The setting of the parameter MaxRequestWorkers is 200. It is normal? Do I have to increase the value of MaxRequestWorkers?
    0
  • cPRex Jurassic Moderator
    Thanks for that screenshot. Nothing in the screenshot looks out of the ordinary for me, as that seems to be a server handling 100 requests as expected. With 100 idle slots available, I would expect the system to be responding quickly. When you say "It stays locked and reboot to unlock" do the website pages not load at all? Do you get an error in the browser? Do you see anything in the main Apache log at /etc/apache2/logs/error_log?
    0
  • ksgalicia
    Apparently the sum of the values 100 requests currently being processed and 100 idle workers is equal to the value of MaxRequestWorkers, the Apache server stops working... I think the problem is there...
    0
  • cPRex Jurassic Moderator
    That should be fine though, as those 100 workers are idle. You're always welcome to open a ticket with our team so we can check the server directly.
    0
  • ksgalicia
    At what point are idle workers processes killed? In six days there are more than 225 inactive workers who are still there...
    0
  • cPRex Jurassic Moderator
    Just so I am clear on the issue, how can you tell the workers are inactive? If you run this: apachectl fullstatus
    one of the output sections gives a graph of the active process IDs that will look something like this: +--------------------------------------------------------------------------------------------+ | | | | Connections | Threads | Async connections | | Slot | PID | Stopping |-------------------+-------------+--------------------------------| | | | | total | accepting | busy | idle | writing | keep-alive | closing | |------+-------+----------+-------+-----------+------+------+---------+------------+---------| |0 |18873 |no |0 |yes |0 |25 |0 |0 |0 | |------+-------+----------+-------+-----------+------+------+---------+------------+---------| |1 |18876 |no |0 |yes |0 |25 |0 |0 |0 | |------+-------+----------+-------+-----------+------+------+---------+------------+---------| |2 |18877 |no |0 |yes |0 |25 |0 |0 |0 | |------+-------+----------+-------+-----------+------+------+---------+------------+---------| |3 |18882 |no |0 |yes |0 |25 |0 |0 |0 | |------+-------+----------+-------+-----------+------+------+---------+------------+---------| |4 |18885 |no |0 |yes |1 |24 |0 |0 |0 | |------+-------+----------+-------+-----------+------+------+---------+------------+---------| |Sum |5 |0 |0 | |1 |124 |0 |0 |0 | +--------------------------------------------------------------------------------------------+
    You could check the PID on the system to see how long that has been running with this: ps aux | grep #####
    For example, that 18873 process on my example machine is one of the main Apache processes that has been running for 24 hours: # ps aux | grep 18873 nobody 18873 0.0 0.3 709672 7248 ? Sl Jul06 0:00 /usr/sbin/httpd -k start
    0

Please sign in to leave a comment.