你的mbuf缓冲区会不够用.........
也就是会出现
All mbuf clusters exhausted , Please see tuning(7)
这样的提示
需要做的就是调整内核参数了
编辑 /boot/defaults/loader.conf
kern.ipc.nmbclusters="81920"
这个是需要增大的,而且因为这个值是一个大的有点疯狂的设定甚至超出了256的平方65536,所以你还需要调整 kern.maxusers=384.....(这个忘记在哪里调整了..)需要在/boot/defaults/loader.conf中设定,默认是多少我不记得了,这个值意味着你使用81920/512=160MB内存来存储连接缓冲。按照一个连接16K-32K来算,可应对5120-10240个连接。
同时
net.inet.tcp.sendspace=32768
net.inet.tcp.recvspace=16384
这是为了减少每个连接占用的内核空间,这样的话,每个发送连接分配32K,接收连接是16K,基于web服务的特点,这样就可以最少应付(5120+10240)/2=7680个连接了。
现在服务器的情况是
4330/43312/327680 mbufs in use (current/peak/max):
4327 mbufs allocated to data
3 mbufs allocated to packet headers
4027/33234/81920 mbuf clusters in use (current/peak/max)
77296 Kbytes allocated to network (14% of mb_map in use)
0 requests for memory denied
0 requests for memory delayed
0 calls to protocol drain routines
连接情况是
1 CLOSE_WAIT
4 CLOSING
17 LAST_ACK
211 FIN_WAIT_1
255 TIME_WAIT
2158 FIN_WAIT_2
4620 ESTABLISHED
现在表现流畅,高峰时期是这个数值的两倍左右吧,如果被路由限速,那情况就会糟很多,虽然没有有利证据表明...
评论内容
发表评论