Perform the following configuration on each node in the cluster:
- ntp or chrony
- transparent hugepages
Keep in mind that, although YugabyteDB is PostgreSQL compatible and runs a postgres process, it is not a PostgreSQL distribution. The PostgreSQL it runs doesn't need the same OS and system resources that open source PostgreSQL requires. For this reason, the kernel configuration requirements are different.
In particular, the main YugabyteDB process, the YB-TServer, is multi-threaded. As a result, you don't need to modify settings for shared memory and inter-process communication (IPC), because there is no inter-process communication or shared memory in a multi-threaded process model (all memory is shared by the same process).
If your instance does not have public Internet access, make sure the ntp package is installed:
$ sudo yum install -y ntp
As of CentOS 8,
ntp is no longer available and has been replaced by
chrony. To install, run:
$ sudo yum install -y chrony
ulimit is used to limit and control the usage of system resources (threads, files, and network connections) on a per-process or per-user basis.
Run the following command to check the
$ ulimit -a
The following settings are recommended when running YugabyteDB.
core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 119934 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1048576 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 12000 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
Set system-wide ulimits
You can change values by substituting the
-n option for any possible value in the output of
ulimit -a. Issue a command in the following form to change a
$ ulimit -n <value>
-f (file size): unlimited -t (cpu time): unlimited -v (virtual memory): unlimited  -l (locked-in-memory size): unlimited -n (open files): 64000 -m (memory size): unlimited   -u (processes/threads): 64000
Restart serversAfter changing a ulimit setting, the YB-Master and YB-TServer servers must be restarted in order for the new settings to take effect. Check the yb-tserver.INFO file to verify that the ulimits are applied. You can also check the
/proc/<process pid>file to see the current settings.
Changes made using ulimit may revert following a system restart depending on the system configuration. These settings should be applied permanently by adding the following in
* - core unlimited * - data unlimited * - fsize unlimited * - sigpending 119934 * - memlock 64 * - rss unlimited * - nofile 1048576 * - msgqueue 819200 * - stack 8192 * - cpu unlimited * - nproc 12000 * - locks unlimited
/etc/security/limits.d/20-nproc.conf must also be configured to match.
* soft nproc 12000
After changing a
ulimit setting in
/etc/security/limits.conf, you will need to log out and back in. To update system processes, you may need to restart.
Using other distributions
If you're using a desktop-distribution, such as ubuntu-desktop, the settings above may not suffice. The operating system needs additional steps to change
ulimit for GUI login.
In the case of ubuntu-desktop, in
DefaultLimitNOFILE=64000 at the end of file.
Something similar may be needed for other distributions.
If you're using systemd to start the processes, and the ulimits are not propagated, add the ulimits in the
Service section of the systemd configuration file:
[Unit] ..... [Service] ..... ulimits options here [Install] .....
The mappings of ulimit options with values are:
|Data type||ulimit equivalent||Value|
If a ulimit is set to
unlimited, set it to
infinity in the systemd configuration file.
Transparent hugepages should be enabled for optimal performance. By default, they are enabled.
You can check with the following command:
$ cat /sys/kernel/mm/transparent_hugepage/enabled
It is generally not necessary to adjust the kernel command line if the output is as follows:
[always] madvise never
However, if the value is set to "madvise" or "never", you should modify your kernel command line to set transparent hugepages to "always".
You should consult your operating system documentation to determine the best way to modify a kernel command line argument for your operating system.
On RHEL or CentOS 7 or 8, using grub2, the following steps are one solution:
Append "transparent_hugepage=always" to
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap ... transparent_hugepage=always"
Be sure to take a backup of the existing
On BIOS-based machines:
grub2-mkconfig -o /boot/grub2/grub.cfg
On UEFI-based machines:
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Reboot the system.