I have a linux server that keeps getting its NIC overloaded and I need to visualize how and why this is occurring based on connections and CPU utilization. How do I do this?

For example; for me to visualize disk iowait I use tools such as atop and iotop that tell me the PID of the process and its CPU usage; using this information I can find which PID is overloading the server.

The problem is that I'm experiencing the same issue with networking and am unable to isolate and troubleshoot the problem b/c I'm unable to find which processes are linked to which connections (I can use netstat I know but netstat doesn't tell me CPU usage).

Now that I have made that clear I need to be able to monitor conntrack and netfilter for CPU usage and/or kernel time. How do I do this? Conventional tools such as ps, top, and htop are not capable of doing this. I've been suggested to check interrupts but that doesn't seem "right" to me.


The best way that I have found to do this is to watch the kernel time. If the kernel time is high then I'll check /proc/interrupts. To further debug this I'll use perf. pktstat is also good to visualize the flow of traffic.

collectl -stnc is also good.

| improve this answer | |

You can use wireshark / ethereal / tcpdump to dump all of the traffic, implicitly dumping the traffic that overloads the PC. This doesn't get you CPU info, but it tells you exactly what ports and data are involved, which should lead you directly to the process involved.

As with all interactions with a problem system, this measurement may influence the behavior, but that is also more likely to result in a faster answer than a less accurate one (IMO). If this measurement does cause the system to function correctly instead of failing the way you would like, you could use a tap and measure using an external device.

You can also use 'iftop' to show bandwidth hogs, but remember that bandwidth != CPU.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy