Adjust Kernel Setting for Low Latency
You can still apply the changes to the /etc/sysctl.conf
file to further improve the network performance in addition to limiting the number of CPU threads used by the LAN port.
The changes that can be made to the /etc/sysctl.conf
file are focused on optimizing the network stack for better performance, including reducing latency and improving throughput. These changes can help to improve the overall network performance, especially when dealing with high network traffic.
Here are some examples of changes that you can make to the /etc/sysctl.conf
file to optimize the network stack:
net.core.somaxconn = 1024
net.core.netdev_max_backlog = 100000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_no_metrics_save = 1
These settings adjust the maximum number of connections, the maximum backlog size, and the receive and transmit buffer sizes for TCP connections. They also enable TCP features like TCP timestamps, selective acknowledgments, and window scaling, which can help to improve throughput and reduce latency.
After making changes to the /etc/sysctl.conf
file, you should run the sudo sysctl -p
command to apply the changes.
However, keep in mind that making changes to the network stack settings can have unintended consequences, so it's important to test and monitor the network performance carefully after making any changes.
Adjusting these network and kernel settings can potentially improve the performance of ROON server hosting on a Linux system.
Here's a brief explanation of what each setting does:
net.core.somaxconn
: This setting controls the maximum number of pending connections that can be queued for a listening socket. Increasing this value can help to reduce connection timeouts and improve performance for network-intensive applications like ROON.
net.core.netdev_max_backlog
: This setting controls the maximum number of packets that can be queued on a network interface before they are processed. Increasing this value can help to reduce packet loss and improve network performance.
net.core.rmem_max
and net.core.wmem_max
: These settings control the maximum size of receive and send buffers, respectively. Increasing these values can help to improve network throughput for applications like ROON.
net.ipv4.tcp_rmem
and net.ipv4.tcp_wmem
: These settings control the minimum, default, and maximum size of receive and send buffers for TCP connections. Adjusting these values can help to improve network performance for applications like ROON.
net.ipv4.tcp_syncookies
, net.ipv4.tcp_timestamps
, net.ipv4.tcp_sack
, and net.ipv4.tcp_window_scaling
: These settings enable various TCP features that can help to improve network performance and security.
net.ipv4.tcp_no_metrics_save
: This setting disables TCP metrics saving to reduce disk I/O and improve performance.
kernel.sched_rt_runtime_us
: This setting controls the maximum amount of time that real-time processes can run in a given time period. Setting this value to -1
disables the limit, which can be useful for real-time applications like ROON.
Keep in mind that the optimal values for these settings can vary depending on your system's hardware and network configuration. It's important to test any changes on a non-production system before implementing them on a critical system.