This topic describes how to improve the Linux performance by modifying the parameters in the sysctl.conf file of each server.
If you are an individual user, you can skip this topic. If you are an enterprise user, we recommend that you configure the sysctl.conf file.
Note
You must perform this operation on each server.
Modify parameters
Run the following command to open the sysctl.conf file in the /etc/ directory:
vi /etc/sysctl.conf
Add the following content to the sysctl.conf file in the /etc/ directory:
# for oceanbase
## Modify the limit on the asynchronous I/O in the kernel.
fs.aio-max-nr=1048576
## Optimize the network.
net.core.somaxconn = 2048
net.core.netdev_max_backlog = 10000
net.core.rmem_default = 16777216
net.core.wmem_default = 16777216
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.ip_local_port_range = 3500 65535
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_slow_start_after_idle=0
vm.swappiness = 0
vm.min_free_kbytes = 2097152
# Specify the data directory of OceanBase Database.
kernel.core_pattern = /data/core-%e-%p-%t
Note that /data in the kernel.core_pattern field indicates the data directory of OceanBase Database. If you modify the configuration file for a test, you can set fs.aio-max-nr=1048576.
Load parameters
Run the following command to load the parameters and make the changes take effect.
sysctl -p