vm.swappiness = 20 (10) net.core.somaxconn = 256 # max 512 before nginx backlog needs changing net.core.netdev_max_backlog = net.core.rmem_default = 212992 net.core.rmem_max = 212992 # 16777216 net.core.wmem_default = 212992 net.core.wmem_max = 212992 # 16777216 net.ipv4.ip_local_port_range = 1024 65535 # Enables fast recycling of TIME_WAIT sockets. # (Use with caution according to the kernel documentation!) net.ipv4.tcp_tw_recycle = 1 # Allow reuse of sockets in TIME_WAIT state for new connections # only when it is safe from the network stack’s perspective. net.ipv4.tcp_tw_reuse = 1 # Increase the number of outstanding syn requests allowed. # c.f. The use of syncookies. net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.tcp_syncookies = 1 fs.file-max = 98236 # Forking servers, like PostgreSQL or Apache, scale to much # higher levels of concurrent connections if this is made larger, # by at least an order of magnitude: kernel.sched_migration_cost_ns = 5000000 # PostgreSQL specific kernel.sched_autogroup_enabled = 0 # generic noatime for system mounts