阿帕奇 – 最大线程数?

我试过configuration我的Apache服务器,每个线程最多使用120个线程和一个(Oracle)SQL连接。 我通过设置:

MaxClients 120 

在httpd.conf文件中。 我也设置:

 oci8.max_persistent = 1 

在php.ini文件中。

但是,我看到线程数量偶尔会超过120个。我错过了什么吗?

谢谢。

由于bindbn告诉你,你应该检查MPM

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

而当你回答他的时候,你正在使用“prefork”,configuration和worker很相似:

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

更多信息:

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

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

检查MPM:

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

检查是否更改了正确的部分:

 <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