This topic describes how to improve the Linux performance by modifying parameters in the sysctl.conf file.
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:
sudo vim /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_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_slow_start_after_idle = 0
vm.swappiness = 0
vm.min_free_kbytes = 2097152
vm.overcommit_memory = 0
fs.file-max = 6573688
fs.pipe-user-pages-soft = 0
# Modify the number of virtual memory areas that a process can have.
vm.max_map_count = 655360
# Specify the data directory of OceanBase Database.
kernel.core_pattern = /data/core-%e-%p-%t
In the file above, /data in the kernel.core_pattern parameter indicates the data directory of OceanBase Database.
Notice
If the max_map_count parameter is set to an unreasonable value, serious memory leakage may occur.
Load parameters
Run the following command to load the parameters and make the changes take effect:
sysctl -p
Deployment suggestions in an Arm environment
Enable NUMA support in BIOS/UEFI and kernel boot parameters.
Run the following command to disable NUMA balancing to avoid performance jitters during balancing:
sysctl kernel.numa_balancing=0Run the following command to disable memory reclamation and reallocation:
sysctl vm.zone_reclaim_mode=0