Disabling the nf_conntrack Module
Skip this section if a container is used.
Purpose
Disable the nf_conntrack module if NAT is not used. The nf_conntrack module of the kernel performs NAT. However, if NAT is not used, enabling the nf_conntrack module causes unnecessary CPU consumption and even causes packet loss due to full table records. Therefore, you can disable the nf_conntrack module to improve performance.
Procedure
- Open the blacklist.conf file.
1vim /etc/modprobe.d/blacklist.conf - Press i to enter the insert mode and add the following content to the file:
install nf_conntrack /bin/false blacklist nf_conntrack blacklist nf_conntrack_ipv6 blacklist xt_conntrack blacklist nf_conntrack_ftp blacklist xt_state blacklist iptable_nat blacklist ipt_REDIRECT blacklist nf_nat blacklist nf_conntrack_ipv4
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Restart the server to make the file take effect.
Parent topic: OS Tuning