优化linux启动项
1. 使用ntsysv工具讲不需要的服务关闭
2. 默认启动服务可以只保留必要的服务
3. free -m 以m为单位
4. 删除不必要的用户:
5. cp /etc/passwd /etc/passwd.sav
6. cp /etc/group /etc/group.sav
7. for a in adm lp sync news uucp operator games
内核参数优化
- vim /etc/sysctl.conf
- sysctl -p 让内核配置生效
- 提高linux内核打开文件数量:
- echo 'ulimit -HSn65536'>>/etc/profile
- echo 'ulimit -hSn65536'>>/etc/rc.local
- source /etc/profile
netstat 检测通信连接
####80业务端口连接数
netstat -an|grep 80|grep FIN_WAIT2|wc -l
####统计linux tcp等待timewait个数
netstat -ntp |awk '{print $6}'|sort |uniq -C