Увеличение лимитов linux
nano /etc/security/limits.conf
* - nofile 999999 * soft nofile 500000 * hard nofile 500000 root soft nofile 500000 root hard nofile 500000 root soft nproc unlimited root hard nproc unlimited
Тюнинг sysctl.conf
nano /etc/sysctl.conf
net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.ip_local_port_range = 10240 65535 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.all.send_redirects = 0 net.ipv4.tcp_max_orphans = 65536 net.ipv4.tcp_fin_timeout = 10 net.ipv4.tcp_keepalive_time = 1800 net.ipv4.tcp_keepalive_intvl = 15 net.ipv4.tcp_keepalive_probes = 5 net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_mem = 50576 64768 98152 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.tcp_orphan_retries = 0 net.ipv4.tcp_syncookies = 0 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_sack = 1 net.ipv4.tcp_congestion_control = htcp net.ipv4.tcp_no_metrics_save = 1 net.ipv4.route.flush = 1 net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.lo.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.lo.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_rfc1337 = 1 net.ipv4.ip_forward = 1 net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.icmp_echo_ignore_all = 0 net.ipv4.icmp_ignore_bogus_error_responses = 1 net.ipv4.tcp_adv_win_scale = 2 net.ipv4.tcp_moderate_rcvbuf = 1 net.ipv4.tcp_rmem = 4096 262144 4194304 net.ipv4.tcp_wmem = 4096 262144 4194304 net.ipv4.tcp_keepalive_time = 900 net.ipv4.tcp_keepalive_intvl = 900 net.ipv4.tcp_keepalive_probes = 9 net.ipv4.tcp_max_syn_backlog = 65536 net.core.somaxconn = 65535 net.core.rmem_default = 16777216 net.core.wmem_default = 65536 net.core.rmem_max = 67108864 net.core.wmem_max = 16777216 net.core.wmem_default = 262144 net.core.wmem_max = 4194304 net.core.netdev_max_backlog = 100000 fs.file-max=99999999 fs.inotify.max_user_watches = 16777216 kernel.sem = 350 358400 64 1024 #so_rcvbuf='16777216', so_rcvbuf_set='8388608'