Apache – maximum number of threads?

Posted on

Apache – maximum number of threads? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, , , , .

I’ve tried to configure my Apache server to use a maximum of 120 threads and one (Oracle) SQL connection per thread. I did this by setting:

MaxClients 120

in httpd.conf file. I also set:

oci8.max_persistent = 1

in php.ini file.

However, I see the number of threads/connections occasionally going over 120. Am I missing something?

Thanks.

Solution :

As bindbn tells you, you should check the MPM

# apache2 -V | grep "Server MPM" 
Server MPM:     XXXX

And as you answer him, you’re using ‘prefork’, configuration it’s pretty similar to worker:

<IfModule prefork.c>
  StartServers            8
  MinSpareServers         5
  MaxSpareServers        20
  MaxClients            150
  MaxRequestsPerChild  1000
</IfModule>

More info:

http://www.devside.net/articles/apache-performance-tuning

http://www.camelrichard.org/apache-prefork-vs-worker

Check MPM:

# apache2 -V | grep "Server MPM"
Server MPM:     Worker

Check that the correct section changed:

<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      60
    ThreadLimit          55
    ThreadsPerChild      25
    MaxClients          120
    MaxRequestsPerChild   0
</IfModule>

http://httpd.apache.org/docs/current/mod/mpm_common.html

Leave a Reply

Your email address will not be published. Required fields are marked *