linux优化

优化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 

内核参数优化

  1. vim /etc/sysctl.conf
  2. sysctl -p 让内核配置生效
  3. 提高linux内核打开文件数量:
    1. echo 'ulimit -HSn65536'>>/etc/profile
    2. echo 'ulimit -hSn65536'>>/etc/rc.local
    3. 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
posted @ 2019-06-13 17:30  风许下的泪  阅读(504)  评论(0编辑  收藏  举报