Rate This Document
Findability
Accuracy
Completeness
Readability

Modifying System Configuration Items

Perform the operations in this section on CentOS 8.1 only. Skip this section for other OSs.

Modifying limits.conf

  1. Edit the /etc/security/limits.conf file.
    vim /etc/security/limits.conf
  2. 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

  3. Press Esc, type :wq!, and press Enter to save the file and exit.

Restarting the OS

  1. Restart the OS for the previous modification to take effect.
    reboot
  2. Verify that the new configuration takes effect.
    sestatus

    ulimit -n

Optimizing Kernel Parameters

  1. Edit the /etc/sysctl.conf file.
    vim /etc/sysctl.conf
  2. 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
  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Make the configuration take effect.
    sysctl -p

Configuring resolv.conf

  1. View the resolv.conf file.
    ls /etc/resolv.conf
  2. Open the resolv.conf file.
    vim /etc/resolv.conf
  3. 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
  4. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. View the resolv.conf file.
    cat /etc/resolv.conf