Optimizing HTTP server performance on Linux

via DebianHelp

Disabling the TCP options reduces the overhead of each TCP packet and might help to get the last few percent of performance out of the server. Be aware that disabling these options most likely decreases performance for high-latency and lossy links.

net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0

Increasing the TCP send and receive buffers will increase the performance a lot if (and only if) you have a lot of large files to send.

net.ipv4.tcp_wmem = 4096 65536 524288
net.core.wmem_max = 1048576

If you have a lot of large file uploads, increasing the receive buffers will help.

net.ipv4.tcp_rmem = 4096 87380 524288
net.core.rmem_max = 1048576