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 the configuration
Run the following command to open the /etc/sysctl.conf configuration file:
[admin@test001 ~]$ sudo vim /etc/sysctl.conf
Add the following content to the /etc/sysctl.conf configuration file:
#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
## Set the core file name format and directory
kernel.core_pattern = /data/core-%e-%p-%t
Here, /data in kernel.core_pattern indicates the data directory of OceanBase Database.
Notice
If the
max_map_countparameter is set to an unreasonable value, serious memory leakage may occur.You must reserve disk space for the core file directory that is at least equal to the
memory_limitconfigured for OBServer. Avoid affecting the available space of the data directory and log directory.
Load the configuration
After modifying the configuration, run the following command to load the configuration and make it take effect:
[admin@test001 ~]$ sudo sysctl -p
Deployment suggestions in Arm and Hygon architecture environments
Enable NUMA support in BIOS/UEFI and kernel boot parameters.
In Arm and Hygon architecture environments, we recommend that you modify the
/etc/sysctl.confconfiguration file and set the parameterskernel.numa_balancing,vm.zone_reclaim_mode, andvm.swappinessto0. Run the following command to open the/etc/sysctl.conffile:[admin@test001 ~]$ sudo vim /etc/sysctl.confAdd the following content to the
/etc/sysctl.conffile:## Disable NUMA balancing to avoid performance jitter during balancing kernel.numa_balancing = 0 ## Disable memory reclamation and reallocation vm.zone_reclaim_mode = 0 vm.swappiness = 0Apply the values in the
sysctl.confconfiguration file:[admin@test001 ~]$ sudo sysctl -p