- 论坛徽章:
- 0
|
一个负载比较重的discuz论坛服务器,1小时在线一万多,有时访问时无法显示。
我用另一台同网段的机器作测试,大概20次中会有1、2次超时
- wget [url]http://bbs.xxx.com[/url]
- --17:06:08-- [url]http://bbs.xxx.com/[/url]
- 正在解析主机 bbs.xxx.com... 221.13.18.b
- Connecting to bbs.xxx.com|221.13.18.b|:80... 失败:连接超时。
- 重试中。
复制代码
在bbs上用tcpdump监控
正常时可以接收到
......
17:27:55.746530 IP 221.13.18.a.39495 > 221.13.18.b.http: . ack 193785 win 353
17:27:55.746923 IP 221.13.18.a.39495 > 221.13.18.b.http: . ack 196705 win 353
17:27:55.747276 IP 221.13.18.a.39495 > 221.13.18.b.http: F 128:128(0) ack 197467 win 353
17:27:55.747284 IP 221.13.18.b.http > 221.130.185.a.39495: . ack 129 win 12
如果wget失败就监控不到信息,问下怎么回事?
检察了net.ipv4.tcp_max_syn_backlog 应该足够了
系统信息
======================================
centos 5.2 64bit
nginx+php+mysql
nginx 4个进程
php 96个进程
Linux bora 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
sysctl内核
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog = 32768
net.core.somaxconn = 32768
net.ipv4.tcp_max_tw_buckets = 5000
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 196608 262144 393216
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 120
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_syncookies = 1
优化文件句柄
vi /etc/security/limits.conf
* soft nofile 51200
* hard nofile 51200
vi /etc/rc.local
ulimit -SHn 51200
===================
Active connections: 2419
server accepts handled requests
73668795 73668795 232420556
Reading: 11 Writing: 28 Waiting: 2380
bbs在线会员 - 总计 13433 人在线
top - 13:29:01 up 33 days, 22:53, 2 users, load average: 1.22, 1.60,
Tasks: 265 total, 1 running, 264 sleeping, 0 stopped, 0 zombie
Cpu(s): 9.3%us, 1.4%sy, 0.0%ni, 88.2%id, 0.5%wa, 0.0%hi, 0.6%si,
Mem: 8168412k total, 6691148k used, 1477264k free, 917728k buffe
Swap: 4096532k total, 228k used, 4096304k free, 3841696k cache
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
TIME_WAIT 4845
SYN_SENT 1
FIN_WAIT1 185
ESTABLISHED 2698
FIN_WAIT2 381
SYN_RECV 162
CLOSING 5
LAST_ACK 137
netstat -n |wc -l
8441
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max
65536
cat /proc/sys/fs/file-nr
4590 0 765985
[ 本帖最后由 godamen 于 2009-10-15 17:46 编辑 ] |
|