shikantazacomputers.github.io

Proxy server performance tuning

Server throughput is determined by many factors:

To improve proxy server throughput, you must determine where the bottleneck is. Choosing a VPS provider with better networking or choosing a larger VPS may sometimes be the solution. A certain amount of improvement can be made by tuning the VPS kernel networking parameters. The following suggested buffer sizes, etc., have been copied from https://gist.github.com/loskiq/f6d9348c8cfd8573a90cafda88a57392.

# maximum open file descriptors
fs.file-max = 51200

# maximum socket buffer sizes 
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864

# minimum size, initial size, and maximum buffer sizes
net.ipv4.tcp_mem = 25600 51200 102400
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864

# bbr congestion control
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

To implement the above suggestions, add the above lines to /etc/sysctl.conf, then issue the command:

sysctl -p