应用实例

TCP 相关参数:

  • net.core.somaxconn = 65535
  • net.ipv4.tcp_fin_timeout = 5
  • net.ipv4.tcp_max_syn_backlog = 65536
  • net.ipv4.tcp_max_tw_buckets = 5000
  • net.ipv4.tcp_synack_retries = 2
  • net.ipv4.tcp_syncookies = 1
  • net.ipv4.tcp_tw_reuse = 1

TCP keepalive 相关参数

  • net.ipv4.tcp_keepalive_intvl = 30
  • net.ipv4.tcp_keepalive_probes = 10
  • net.ipv4.tcp_keepalive_time = 600

其他

  • net.bridge.bridge-nf-call-iptables = 1
  • net.bridge.bridge-nf-call-ip6tables = 1
  • net.ipv6.conf.all.disable_ipv6 = 1
  • net.ipv6.conf.lo.disable_ipv6 = 1
  • net.ipv4.neigh.default.gc_stale_time = 120
  • net.ipv4.conf.all.rp_filter = 0

内存相关相关

  • vm.drop_caches = NUM
  • vm.swappiness = 10
  • vm.max_map_count = 262144
  • vm.overcommit_memory = 1
  • vm.overcommit_ration = 50
  • vm.panic_on_oom = 0
  • vm.oom_kill_allocating_task = 0

文件系统相关参数

  • fs.file-max = 52706963
  • fs.nr_open = 52706963
  • fs.may_detach_mounts = 1