3 ms·
netstat -s gives protocol statistics, some of which might be useful, you might also have ethernet interface statistics somewhere in case the interface is droppi
by toast0 5y ago
netstat -s gives protocol statistics, some of which might be useful, you might also have ethernet interface statistics somewhere in case the interface is dropping packets (on FreeBSD, interface stats for nice drivers will be in sysctl dev.X where X is the driver name; some drivers have better data than others, but I haven't debugged Linux issues enough to find the same data there)
Either way, tcpdump on the host or the client (sometimes you need dumps from both) should tell the tale. You probably don't need or want wireshark in between the peers, a capture from either can be loaded at your leasure. If you suspect a non-application issue, you can do -s 64 or so and not capture most of the application data, but still have all the TCP headers. pcaps aren't always exactly the truth about what's on the wire, but they're pretty close.
Personally, I get a lot of mileage out of Wireshark, so every problem report looks like a pcap. If the server is really busy, the pcaps get too big, and you have to do things like short bursts of capturing and hope you see the issue in the burst, or sampling, but if your server isn't very busy, you can do things like pcap all the packets, and ask for problem reports to include client ip and port number and then you can find it in the big pcap a lot easier.
- tptacek 5y agoWireshark, tcpdump, and pcap tools in general are probably way overkill for basic network statistics issues.
- toast0 5y agoOverkill is the best kind of kill! Client and server disagree on p99 times by a lot and there's enough reports to actually look into it says there's probably something interesting going on, and pcap will tell you what it is. And you'll almost always see at least a few other things that might be worth fixing while you're looking at pcaps; some of which might actually be fixable. Sometimes you even get lucky and can see what traffic was going on before the mysterious gap in packets, and make a good guess at what's blocking your rx queues or whatever. Stats are nice too, of course.