Ubuntu优化之sysctl.conf配置

这个配置主要是加大系统连接数限制,减少超时等待等,可应用于大并发的web服务器。

vm.swappiness = 10

vm.overcommit_memory = 1

net.ipv4.ip_local_port_range = 1024 65535

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_fin_timeout = 20

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_timestamps = 1

net.ipv4.tcp_window_scaling = 0

net.ipv4.tcp_sack = 0

net.core.netdev_max_backlog = 32768

net.ipv4.tcp_no_metrics_save = 1

net.core.somaxconn = 16384

net.ipv4.tcp_max_syn_backlog = 262144

net.ipv4.tcp_syncookies = 1

net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_max_orphans = 262144

net.ipv4.tcp_synack_retries = 1

net.ipv4.tcp_syn_retries = 1

net.ipv4.tcp_max_tw_buckets = 5000

net.ipv4.tcp_keepalive_time = 1200

net.ipv4.tcp_keepalive_probes = 3

net.ipv4.tcp_keepalive_intvl = 30

fs.file-max = 655350


发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。