Iptables-l-t filter output is slow

Source: Internet
Author: User
Tags cpu usage iptables

When this happens, try using iptables-n-l-t filter and add a-n command-line option.

A few days ago, when maintaining a seemingly inaccessible Linux server, the Iptables-l-T filter command output was found to be very slow. One of the processes in the system takes up a lot of CPU resources, but when viewed with the top command, the CPU usage is found to be low.

After careful observation, it is found that every time you output a rule with an IP address, it will stop there. is related to the IP address. Suddenly remembered iptables command the default output is the host name, which requires communication with the DNS server (if a DNS server is configured). With the nameserver annotation in the/etc/resolve.conf, the Iptables-l-T filter command is called, and the output is immediately expected. Indeed, with DNS, ping two DNS servers, it seems that the network operators there is a problem ...

Restore/etc/resolve.conf file, use Iptables-n-l-t filter, immediately returned ...

-N option, the host and port are digitally printed and will not query host names (DNS PTR queries are slow). , as well as the corresponding service name of the port number (if it is their own program, occupy the port in/etc/service, is common, direct output port number is more intuitive).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.