Linux pile TCP/IP TIME_WAIT Apache

Voir

man netstat

mode Prefork Vs Worker

ps -efL |grep http | wc -l
netstat -nat |sed '2d' | awk '{print $6}' | sort | uniq -c | sort -n

1 Foreign
4 SYN_RECV
12 LISTEN
131 ESTABLISHED
191 CLOSE_WAIT
270 TIME_WAIT

Source: https://www.skyminds.net/serveur-dedie-reduire-les-connexions-time_wait-des-sockets-et-optimiser-tcp/

Ou mieux

# ss -s
Total: 281 (kernel 3060)
TCP: 10 (estab 4, closed 0, orphaned 0, synrecv 0, timewait 0/0), ports 0
Transport Total IP IPv6
* 3060 - -
RAW 0 0 0
UDP 2 2 0
TCP 10 7 3
INET 12 9 3
FRAG 0 0 0

Voir commande ss

ss -t4 state time-wait ss -t4 state established

Pile TCP/IP

cat /proc/sys/net/ipv4/tcp_fin_timeout
0
cat /proc/sys/net/ipv4/tcp_tw_recycle
0
cat /proc/sys/net/ipv4/tcp_tw_reuse
60

echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse

1 Foreign
1 SYN_RECV
12 LISTEN
29 CLOSE_WAIT
58 ESTABLISHED
217 TIME_WAIT