Apache - 最大线程数?

Dar*_*rio 4 apache-2.2

我尝试将我的 Apache 服务器配置为最多使用 120 个线程和每个线程一个 (Oracle) SQL 连接。我通过设置做到了这一点:

MaxClients 120
Run Code Online (Sandbox Code Playgroud)

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

oci8.max_persistent = 1
Run Code Online (Sandbox Code Playgroud)

在 php.ini 文件中。

但是,我看到线程/连接的数量偶尔会超过 120。我是否遗漏了什么?

谢谢。

小智 6

正如 bindbn 告诉你的,你应该检查 MPM

# apache2 -V | grep "Server MPM" 
Server MPM:     XXXX
Run Code Online (Sandbox Code Playgroud)

当你回答他时,你正在使用“prefork”,它的配置与工作人员非常相似:

<IfModule prefork.c>
  StartServers            8
  MinSpareServers         5
  MaxSpareServers        20
  MaxClients            150
  MaxRequestsPerChild  1000
</IfModule>
Run Code Online (Sandbox Code Playgroud)

更多信息:

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

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

  • 两个链接都坏了。 (2认同)

归档时间:

查看次数:

36324 次

最近记录:

12 年 前