精确调整Apache 2 MPM Prefork模块参数

我在一台装有3GB内存的Linux Debian机器(内核2.6,Debian 5)上运行Apache 2。 这个服务器应该每24小时处理约2亿个请求。 任何人都可以告诉我什么应该是下面的mpm_prefork参数的值可以适应这个负载? 我想要设置的参数是:

  1. 将ServerLimit
  2. StartServers的
  3. 比MinSpareServers
  4. MaxSpareServers的
  5. MaxClients的
  6. MaxRequestsPerChild

我也想知道MaxKeepAliveRequests参数应该是什么值。

提前10倍

你将会耗尽内存,然后你将能够服务百万个请求。 你的apache客户端进程有多大? 我打赌超过10MB(可能是25MB)。 如果客户端只有10MB,那么你的服务器可能只能处理250个客户端。

可以用fast-cgi尝试lighttpd。

为了回答你的问题,你需要为我编辑mpm.conf文件/etc/apache2/modules.d/00_mpm.conf,但是在gentoo上,所以它会有点不同,这取决于你正在使用的linux的发行版。 但是在这个configuration中有一个prefork的secion

这是我的一个12G的ram服务器。 (并且我们负载均衡20个相同服务器的站点)

 <IfModule mpm_prefork_module> StartServers 100 MinSpareServers 5 MaxSpareServers 200 ServerLimit 375 MaxClients 375 MaxRequestsPerChild 0 </IfModule>