Posts Tagged networking

Reducing TIME_WAIT sockets in Nginx and Apache

Edit /etc/sysctl.conf and add

# 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

After this run in terminal

sysctl -p

 

PS: DO NOT USE THIS IF YOUR CLIENTS ARE BEHIND A NAT (Thanks Jero).

Advertisements

,

1 Comment