阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

通用Linux接口服务器参数调优

120次阅读
没有评论

共计 1031 个字符,预计需要花费 3 分钟才能阅读完成。

如果需要支撑百万级同时在线数,需要对 Linux 默认内核参数进行调整,我们的典型配置是在 /etc/sysctl.conf 增加以下内容:

    net.ipv4.tcp_max_syn_backlog = 120000
    net.core.netdev_max_backlog = 120000
    net.core.somaxconn = 12000
    net.ipv4.tcp_fin_timeout = 2
    net.ipv4.tcp_tw_reuse = 1
    net.ipv4.tcp_tw_recycle = 1
    net.ipv4.tcp_max_tw_buckets = 1000
    net.ipv4.tcp_abort_on_overflow = 1
    net.ipv4.tcp_sack = 1
    net.ipv4.tcp_rmem = 4096 8192 32768
    net.ipv4.tcp_wmem = 4096 8192 32768
    net.core.optmem_max = 8192
    net.ipv4.tcp_timestamps = 0
    net.ipv4.tcp_mem = 3075840  4101120  12303360
    net.ipv4.tcp_keepalive_time = 30
    net.ipv4.tcp_keepalive_probes = 5
    net.ipv4.tcp_keepalive_intvl = 15
    net.netfilter.nf_conntrack_tcp_timeout_last_ack = 3
    net.ipv4.tcp_synack_retries = 1
    net.ipv4.tcp_syn_retries = 1
    net.ipv4.ip_local_port_range = 1024    65535
    net.nf_conntrack_max = 6553600
    net.netfilter.nf_conntrack_max = 6553500
    net.netfilter.nf_conntrack_tcp_timeout_established = 180

    修改 /etc/security/limits.conf 配置:
    *              soft    nofile          1200000
    *              hard    nofile          1200000

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-01/127475.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计1031字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中