Modifying System Configuration Items
Perform the operations in this section on CentOS 8.1 only. Skip this section for other OSs.
Modifying limits.conf
- Edit the /etc/security/limits.conf file.
vim /etc/security/limits.conf
- Press i to enter the insert mode and add the following content to the end of the file:
* soft nofile 65536 * hard nofile 65536 * soft nproc 131072 * hard nproc 131072

- Press Esc, type :wq!, and press Enter to save the file and exit.
Restarting the OS
- Restart the OS for the previous modification to take effect.
reboot
- Verify that the new configuration takes effect.
sestatus

ulimit -n

Optimizing Kernel Parameters
- Edit the /etc/sysctl.conf file.
vim /etc/sysctl.conf
- Press i to enter the insert mode and add the following content to the file:
kernel.shmmax = 500000000 kernel.shmmni = 4096 kernel.shmall = 4000000000 kernel.sem = 250 512000 100 2048 kernel.sysrq = 1 kernel.core_uses_pid = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.msgmni = 2048 net.ipv4.tcp_syncookies = 1 net.ipv4.ip_forward = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.conf.all.arp_filter = 1 net.ipv4.ip_local_port_range = 1025 65535 net.core.netdev_max_backlog = 10000 net.core.rmem_max = 2097152 net.core.wmem_max = 2097152 vm.overcommit_memory = 2
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Make the configuration take effect.
sysctl -p

Configuring resolv.conf
- View the resolv.conf file.
ls /etc/resolv.conf
- Open the resolv.conf file.
vim /etc/resolv.conf
- Press i to enter the insert mode and add the following content to the file:
# Generated by NetworkManager nameserver 114.114.114.114 nameserver 8.8.8.8
- Press Esc, type :wq!, and press Enter to save the file and exit.
- View the resolv.conf file.
cat /etc/resolv.conf
Parent topic: Configuring the Compilation Environment