+2 votes
in Web & Google by (11.1k points)
edited by

My website is working fine and I never found it down, but there are several lines of the following messages. What could be the error and how to fix it?


[Fri Jun 15 03:04:18.746031 2018] [mpm_event:notice] [pid 6953:tid 140224217511808] AH00492: caught SIGWINCH, shutting down gracefully
[Fri Jun 15 03:04:25.445796 2018] [mpm_event:notice] [pid 9013:tid 140001961908096] AH00489: Apache/2.4.29 (Unix) configured -- resuming normal operations
[Fri Jun 15 03:04:25.445951 2018] [core:notice] [pid 9013:tid 140001961908096] AH00094: Command line: '/usr/local/apache/bin/httpd'

 

1 Answer

0 votes
by (15.8k points)
edited by

There could be many problems. One possibility is very high or very value of MaxRequestWorkers / MaxClients. The value of MaxRequestWorkers is dependent on the value of ServerLimit. The default value of ServerLimit in Apache is 256 for MPM prefork and 16 for MPM worker and event. 

From Apache's website (https://httpd.apache.org/docs/current/mod/mpm_common.html)

The MaxRequestWorkers directive sets the limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxRequestWorkers limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process is freed at the end of a different request, the connection will then be serviced.

For non-threaded servers (i.e., prefork), MaxRequestWorkers translates into the maximum number of child processes that will be launched to serve requests. The default value is 256; to increase it, you must also raise ServerLimit.

For threaded and hybrid servers (e.g. event or worker) MaxRequestWorkers restricts the total number of threads that will be available to serve clients. For hybrid MPMs the default value is 16 (ServerLimit) multiplied by the value of 25 (ThreadsPerChild). Therefore, to increase MaxRequestWorkers to a value that requires more than 16 processes, you must also raise ServerLimit.

MaxRequestWorkers also depends on the size of the RAM. If your RAM size is small, you cannot set a very large value for MaxRequestWorkers. Use this approach to determine the value of MaxRequestWorkers.

For Prefork: If you have 1 gb RAM, leave about 400MB for the system. The size of a normal Apache process is 12mb-25mb depending on your configurations and applications. Let's assume each apache process is 20mb, so MaxRequestWorkers = 600/20 = 30. The recommended value of MaxRequestWorkers on 1gb VPS is 25-50. If you have a busy website, increase the RAM size or use MPM event/worker.

For Event/Worker : If you have 1gb RAM, set ServerLimit to 16 and MaxRequestWorkers to 100 -150 (multiple of ThreadPerChile) i.e. ServerLimit >= MaxRequestWorkers/ThreadPerChild. If these values do not work, try to lower ServerLimit and hence MaxRequestWorkers.

For 2gb VPS, the preferred settings for MPM prefork, event and worker are as follows:

# prefork MPM

# StartServers: number of server processes to start

# MinSpareServers: minimum number of server processes which are kept spare

# MaxSpareServers: maximum number of server processes which are kept spare

# MaxRequestWorkers: maximum number of server processes allowed to start

# MaxConnectionsPerChild: maximum number of connections a server process serves

#                         before terminating

<IfModule mpm_prefork_module>

    StartServers            5

    MinSpareServers         5

    MaxSpareServers         10

    MaxRequestWorkers       75

    MaxConnectionsPerChild  5000

</IfModule>

# worker MPM

# StartServers: initial number of server processes to start

# MinSpareThreads: minimum number of worker threads which are kept spare

# MaxSpareThreads: maximum number of worker threads which are kept spare

# ThreadsPerChild: constant number of worker threads in each server process

# MaxRequestWorkers: maximum number of worker threads

# MaxConnectionsPerChild: maximum number of connections a server process serves

#                         before terminating

<IfModule mpm_worker_module>

    StartServers            3

    MinSpareThreads         50

    MaxSpareThreads         100 

    ThreadsPerChild         25

    ServerLimit 16

    MaxRequestWorkers       300

    MaxConnectionsPerChild  5000

</IfModule>

# event MPM

# StartServers: initial number of server processes to start

# MinSpareThreads: minimum number of worker threads which are kept spare

# MaxSpareThreads: maximum number of worker threads which are kept spare

# ThreadsPerChild: constant number of worker threads in each server process

# MaxRequestWorkers: maximum number of worker threads

# MaxConnectionsPerChild: maximum number of connections a server process serves

#                         before terminating

<IfModule mpm_event_module>

    StartServers            3

    MinSpareThreads         50

    MaxSpareThreads         100

    ThreadsPerChild         25

    ServerLimit 16

    MaxRequestWorkers       300

    MaxConnectionsPerChild  5000

</IfModule>

...