Problem: my music server code, using a simple TCP connection on a blocking socket, needs to stream bytes out to a client (happens to be a Logitech squeezebox). It's not complicated - read 64k from a file, write it to the squeezebox, repeat. It's all running on a not-at-all-busy local LAN, and the server and squeezebox client are plugged into the same switch. The squeezebox doesn't consume the stream very quickly so the server, on pretty much any hardware, should have no trouble keeping the client fed.
And when the server runs on a Raspberry pi 3B+, it in fact has no problem at all. A pi zero could probably keep up. When it runs on my Linux laptop, ditto, everything is fine. I can ask the squeezebox periodically how full it's internal buffer is and it quickly gets up to about 99+%, and stays there. The server write()s (after the first few), spend most of their time blocked, as you'd expect.
But I move the server to a Azulle Inspire running Linux, plugged into the same switch, and something goes horribly wrong. Music starts to play but rapidly stutters and dies. The squeezebox reports the buffer is starting to fill, but then something stalls out and the buffer quickly empties (sometimes ticking up slightly, so I think some traffic gets through, but not near enough), halting the music. The server claims it's continuing writing, though writes take longer than I'd expect.
Note that the Azulle has other occasional networking duties and they all work fine, though I probably wouldn't notice short networking delays for most of those other applications. But when the music server is running, the NUC (and network) are otherwise idle - this isn't a CPU or bandwidth problem.
I've tried changing cables, changing switches and using different ports on the switches. I've tried sending different buffer sizes. To no effect. All I can come up with is there is something very wonky about the TCP stack or ethernet hardware.
How do I debug this? The linux laptop, which streams out just fine, is running Linux 4.15.0-55-generic (and apt upgrade doesn't change that). The Azuelle is running Linux 4.15.0-64-generic, Mint. I can't believe there's a radical change in TCP handling within 4.15.0. I'm not very familiar with tools like tcpdump, let along kernel config or debugging, so I'm looking for some hand-holding...
ping times between the linux laptop and Azuelle are consistently around 0.2ms and 0.35ms, with 0.33ms typical.
I'm lost. TIA.