2008/04/19

Tuning the Linux kernel for better network throughput

If your linux server needs to have better network throughput, try this out.
From /etc/sysctl.conf:
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
The first command enables TCP window scaling, which allows clients to download data at a higher rate by enabling extra bits in TCP packets that are used to increase the window size.
The second command enables TCP SYN cookies, which is often enabled by default and is extremely effective in preventing conditions such as SYN floods that can drain the server of resources used to process incoming connections.
The last four options increase the TCP send and receive buffers, which allow an application to move its data out faster so as to serve other requests. This also improves the client's ability to send data to the server when it gets busy.
To make the change immediately:
sysctl -p /etc/sysctl.conf
To see all of the currently configured sysctl parameters:
sysctl -a
You can also use sysctl to make the change:
sysctl -w net.ipv4.tcp_window_scaling=1
This can be useful for testing the effectiveness of certain settings without committing them to being defaults.

沒有留言:

Mercury簡易改裝

有同好有一樣的困擾 - 如何使用自己的data logging軟體,因此寫了這篇來分享我的簡易改裝。 Background 雲豆子 MERCURY roaster 烘豆機的設計是使用自行開發的軟體,來:1. 操控風門/火力; 2. data logging/自動烘焙。 ...