LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   centos7 ping localhost slow (https://www.linuxquestions.org/questions/linux-networking-3/centos7-ping-localhost-slow-4175659056/)

hemouyang 08-13-2019 06:28 AM

centos7 ping localhost slow
 
When my machine was loaded with 10% CPU, 25% memory consumption and enough disk space, ping localhost found that the response time was 6ms, and it was also found that the IP time of other machines in the Intranet ping my machine was about 6ms.The Intranet network has determined that the environment is fine, and I have killed all the services that have been started (e.g. Mysql, redis), and found through traceroute that ping localhost is a local loop.The tcpdump catch tells you that the request is fast but the machine's reply is slow.Rebooting the network card does not work, but reboot will restore the machine to its original response speed of 0.04ms, which will slow down after a period of time.I suspect that the Linux kernel is slow in backpacking from network packets. How to locate and solve the problem?

smallpond 08-13-2019 08:03 AM

When you are seeing the delay, what is the output of these commands (after changing public IPs to XXX)
Code:

sudo iptables -vL
sudo tc -s qdisc


jefro 08-13-2019 02:54 PM

Thoughts.

Not sure you can depend on ping.

If you have any sort of services that were on the localhost then that could leave leftovers.

I'd do a test to a localhost server instead or some file transfer maybe.

Localhost inside of a nic can be quite different than normal traffic too.

Guess it's possible that your loopback test is actually going outside of your nic and back still.

hemouyang 08-13-2019 11:00 PM

Quote:

Originally Posted by smallpond (Post 6024649)
When you are seeing the delay, what is the output of these commands (after changing public IPs to XXX)
Code:

sudo iptables -vL
sudo tc -s qdisc


Thank you very much. I saw that iptables had a large number of Chain INPUT (policy ACCEPT) rules, so many that I could not saw all of them. I saw that iptables had a large number of Chain INPUT (policy ACCEPT) rules, so I guess this may be the reason for my slow response, but I was surprised that I did not know how these rules were generated, and all these rules disappeared after rebooting linux.

hemouyang 08-13-2019 11:02 PM

2 Attachment(s)
Quote:

Originally Posted by hemouyang (Post 6024927)
Thank you very much. I saw that iptables had a large number of Chain INPUT (policy ACCEPT) rules, so many that I could not saw all of them. I saw that iptables had a large number of Chain INPUT (policy ACCEPT) rules, so I guess this may be the reason for my slow response, but I was surprised that I did not know how these rules were generated, and all these rules disappeared after rebooting linux.

Attachment 31116

Attachment 31117

Here are some images of commands

hemouyang 08-13-2019 11:05 PM

Quote:

Originally Posted by jefro (Post 6024815)
Thoughts.

Not sure you can depend on ping.

If you have any sort of services that were on the localhost then that could leave leftovers.

I'd do a test to a localhost server instead of some file transfer maybe.

Localhost inside of a nic can be quite different than normal traffic too.

Guess it's possible that your loopback test is actually going outside of your nic and back still.

thanks,I really should not solve the problem based on Ping, but I found that this is the only phenomenon and I had no clue to locate the problem. I grabbed the packet and analyzed that Ping did not go out of loopback


All times are GMT -5. The time now is 07:52 PM.