侧边栏壁纸
  • 累计撰写 100 篇文章
  • 累计创建 55 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Nginx 简单优化

Malson
2022-06-25 / 0 评论 / 0 点赞 / 58 阅读 / 194 字

【系统参数优化 sysctl】

优化系统最大打开文件数限制:

$ diff  /etc/sysctl.conf.old  /etc/sysctl.conf
41,43c41,57
< fs.file-max=65535
< fs.file-max=65535
< fs.file-max=65535
---
> #fs.file-max=65535
> #fs.file-max=65535
> fs.file-max=70000  #增大系统最大允许的文件句柄数(超过65535)
> net.ipv4.tcp_max_tw_buckets = 6000  #以下这些都是优化网络行为
> net.ipv4.ip_local_port_range = 1024 65000
> net.ipv4.tcp_tw_recycle = 1
> net.ipv4.tcp_tw_reuse = 1
> net.ipv4.tcp_syncookies = 1
> net.core.somaxconn = 262144
> net.core.netdev_max_backlog = 262144
> net.ipv4.tcp_max_orphans = 262144
> net.ipv4.tcp_max_syn_backlog = 262144
> net.ipv4.tcp_synack_retries = 1
> net.ipv4.tcp_syn_retries = 1
> net.ipv4.tcp_fin_timeout = 30
> net.ipv4.tcp_keepalive_time = 1200
> net.ipv4.tcp_orphan_retries = 2
0
博主关闭了所有页面的评论