1.网络基础知识科普
2.判断网卡
执行如下命令获取网卡信息:
#sudo ethtool eth1
如果是虚拟机,可能因为虚拟机系统不支持,而出现如下结果:
Settings for eth1:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available
如果是实体机,则会出现如下网卡信息:
Settings for eth1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 2
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
Link detected: yes
从上面信息不难看出是千兆网卡。
3.fd资源放大
#sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"
4.TIME_OUT问题
HTTP服务测试,通过下面命令查看TIME_OUT状态:
#netstat -lan
如果大量存在,可以执行如下命令来快速回收TIME_OUT资源:
#cd /proc/sys/net/ipv4
#echo 1 > tcp_tw_recycle
也可以通过执行如下命令修改系统参数来解决:
#vim /etc/sysctl.conf
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_timeout = 20
net.ipv4.tcp_timestamps = 0
让配置生效
#sudo sysctl -p
附注:
高负载系统,网络参数调整
5.性能查看
Linux常用性能调优工具索引
tsar
top
perf
阅读(5417) | 评论(0) | 转发(3) |