This topic describes how to improve the performance of a Linux system by modifying the sysctl.conf configuration on the server.
If you are in a personal trial scenario, you can skip this step. If you are using it in a production environment, we recommend that you configure sysctl.conf.
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 kernel asynchronous I/O limit
fs.aio-max-nr = 1048576
## Network Optimization
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 a process can have
vm.max_map_count = 655360
## Set the filename format and directory for core files
kernel.core_pattern = /data/core-%e-%p-%t
In the preceding code, /data in kernel.core_pattern is the data directory of OceanBase Database.
Notice
An unreasonable
max_map_countvalue may cause severe memory leaks.At least as much disk space as the
memory_limitspecified for the OBServer node should be reserved for the core dump directory. Do not compromise the available space for the data and log directories.
Load the configuration
After modifying the configuration, run the following command to load it and make it effective.
[admin@test001 ~]$ sudo sysctl -p
Deployment recommendations for ARM environments
Enable NUMA support in BIOS/UEFI and kernel boot parameters.
In ARM and HiSilicon 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 the balancing process kernel.numa_balancing = 0 ##Disable memory reclamation and reallocation vm.zone_reclaim_mode = 0 vm.swappiness = 0Apply the values from the
sysctl.confconfiguration file:[admin@test001 ~]$ sudo sysctl -p
