Otimizando seu Linux para Alto Tráfego
Vou descrever como otimizar o seu linux para múltiplas conexões e alto tráfego.
Todos os comandos de configuração do kernel podem ser digitados na shell mas aqui estou adicionando todas essas configurações no final do arquivo /etc/sysctl.conf.
root@debian:~# vi /etc/sysctl.conf [...] # Reduzir tempo de limpeza tabela ARP e expandir o tamanho net.ipv4.neigh.default.gc_interval = 15 net.ipv4.neigh.default.gc_thresh1 = 4096 net.ipv4.neigh.default.gc_thresh2 = 8192 net.ipv4.neigh.default.gc_thresh3 = 16384 # Aumentar o número de conexões simultâneas e reduzir o tempo de espera entre elas net.core.somaxconn = 20480 net.core.netdev_max_backlog = 2048 net.ipv4.tcp_fin_timeout = 10 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_syn_retries = 1 net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_max_syn_backlog = 2048 ### Tunning ### ## increase TCP max buffer size setable using setsockopt() net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 ## increase Linux autotuning TCP buffer limits ## min, default, and max number of bytes to use ## set max to at least 4MB, or higher if you use very high BDP paths net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 ## don't cache ssthresh from previous connection net.ipv4.tcp_no_metrics_save = 1 net.ipv4.tcp_moderate_rcvbuf = 1