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:
[admin@test001 ~]$ 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
## Set the file name format and directory of the core file
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_countparameter is set to an unreasonable value, serious memory leakage may occur.You must reserve disk space at least the same size as the
memory_limitconfigured for OBServer for the core file directory, and avoid affecting the available space of the data directory and the log directory.
Load parameters
Run the following command to load the parameters and make the changes take effect:
[admin@test001 ~]$ sudo sysctl -p
Deployment suggestions in an ARM environment
Enable NUMA support in the bios/uefi and kernel boot parameters.
In ARM and Hygon architecture environments, we recommend that you modify the
/etc/sysctl.confconfiguration file and set thekernel.numa_balancing,vm.zone_reclaim_mode, andvm.swappinessparameters to0. 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 jitters 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
