Gabriel
Gabriel

Reputation: 792

Changed mpm-worker 2.4 config but with no effect

I have changed the default configuration to:

<IfModule worker.c>
ServerLimit 20
StartServers            4
MaxRequestWorkers               600
MinSpareThreads         25
MaxSpareThreads         75
ThreadsPerChild         30
MaxConnectionsPerChild  0
</IfModule> 

And when in peak, using server-status, when it reaches 400 sessions, it still doesn't seem to create new workers and remains at 400:

BusyWorkers: 400
IdleWorkers: 0
Scoreboard: KKKKCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKRKCKKKKKKCKKRKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKRKKKKKCKKKCKKKKKRKKKCKKKKKKCKKKKKKKKKKKKRCKKCKKKCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCKKKRKKKKKKKRKKKKKKKKKKKKKCKCKKKKKCKKKCKCKKRCRKKKKKKKKKKKKRKKKKKKKKKKKKKKCKKKKCKKKKKRKCCKKKKKKKKKKKKKKCKKKKKKKRKKKKKKKKKKCKKKCKKRKKCRKKRKKKKKKKKKKKKKCKKKKRKKKKRKKKKCKKKKKRKKKKKKKKKKKKKKKKKKKKRKKKKKKKWKKKKKKKKKKKCKKKK

If I change the user to apache and issue an ulimit -u i get 1024

Any ideas?

Upvotes: 0

Views: 2623

Answers (2)

Gabriel
Gabriel

Reputation: 792

I finally figured out why Apache was not able to create more than 400 workers. It was because of the configuration file format. In our httpd.conf file the settings for worker and prefork modules are written just before the “LoadModule” section. It seems that apache does not like this format so it ignores our values for worker mode and falls back to the default values. The fix is very simple, we have to delete the settings for worker and prefork modules from above “LoadModules” section and put them after this section.

These values are optimal for 1000 simultaneous connections:

# 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
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
    ServerLimit                                         40
    StartServers                                       5
    MinSpareThreads                           25
    MaxSpareServers                           75
    MaxRequestWorkers                   1000
    ThreadsPerChild                             25
    MaxConnectionsPerChild     0
</IfModule>
#
# worker MPM
# StartServers: initial number of -erver processes to start
# MaxClients: maximum number of simultaneous client connections
# 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
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    ServerLimit                                         40
    StartServers                                       5
    MinSpareThreads                           25
    MaxSpareThreads                          75
    MaxRequestWorkers           1000
    ThreadsPerChild                             25
    MaxConnectionsPerChild     0
</IfModule>

After that just stop/start apache process.

Upvotes: 2

Daniel Ferradal
Daniel Ferradal

Reputation: 2890

You need to FULL stop/start for mpm changes to take effect, restart or graceful will still give you the previous settings.

Upvotes: 1

Related Questions