BSD上Apache性能的调整(2)

王朝厨房·作者佚名  2007-01-02
窄屏简体版  字體: |||超大  

maxusers对其他kernel参数产生影响:

进程的最大数目

每个用户进程的最大数目

系统打开文件数目限制

每个用户打开文件数目限制

mbuf clusters最大数目

Proc/pgrp hash表大小这些引申参数的定义公式在/usr/src/sys/conf/param.c中。这些计算出来的参数部分会被kernel配置文建里自己定义的值覆盖:

# Network options. NMBCLUSTERS defines the number of mbuf clusters and

# defaults to 256. This machine is a server that handles lots of traffic,

# so we crank that value.

options NMBCLUSTERS=4096 # mbuf clusters at 4096

#

# Misc. options

#

options CHILD_MAX=512 # maximum number of child processes

options OPEN_MAX=512 # maximum fds (breaks RPC svcs)

在许多情况下,NMBCLUSTERS应该设置的比第一眼看上去需要设置的值大的多。这是因为如果浏览器在传输中中断了连接,与特定连接相关的socket fd要在TIME_WAIT状态等几分钟才释放,在等待时mbuf并没有释放。另外,在服务器的timeouts中,一些连接会停留在FIN_WAIT_2状态,这个状态不会超时,浏览器又不会发出最终的FIN信号。

关于mbuf clusters更多的信息(From sys/mubf.h)

/*

* Mbufs are of a single size, MSIZE (machine/machparam.h), which

* includes overhead. An mbuf may add a single "mbuf cluster" of size

* MCLBYTES (also in machine/machparam.h), which has no additional overhead

* and is used instead of the internal data area; this is done when

* at least MINCLSIZE of data must be stored.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航