Centos系統調優

Linux系統優化vim

1、最大文件打開數緩存

ulimit -asocket

ulimit -n 100000tcp

ulimit -u 65535優化

可經過修改啓動文件:ip

vi /etc/rc.local;it

二,調優最大TCP鏈接數io

vim /etc/sysctl.conf配置

# Increase system IP port limits to allow for more connectionsim

# 調高系統的 IP 以及端口數據限制,從能夠接受更多的鏈接

net.ipv4.ip_local_port_range = 2000 65000

net.ipv4.tcp_window_scaling = 1

# number of packets to keep in backlog before the kernel starts dropping them

# 設置協議棧能夠緩存的報文數閥值,超過閥值的報文將被內核丟棄

net.ipv4.tcp_max_syn_backlog = 3240000

# increase socket listen backlog

# 調高 socket 偵聽數閥值

net.core.somaxconn = 3240000

net.ipv4.tcp_max_tw_buckets = 1440000

# Increase TCP buffer sizes

# 調大 TCP 存儲大小

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_congestion_control = cubic

 

每次修訂配置以後都須要執行如下命令使之生效.

sysctl -p /etc/sysctl.conf

相關文章
相關標籤/搜索