February 8, 2012 11:42 AM Subscribe
How do I fix this fast-then-slow download issue on a Linux machine? It doesn't happen on a Windows machine. TCP tuning nerdery probably required.
posted by Kadin2048 to Computers & Internet (10 answers total) 4 users marked this as a favorite
My office has a 12 megabit symmetric connection, shared between a dozen users or so via a SonicWall edge router and a 100MbE switch.
When running "yum update" on a Fedora machine, I noticed that downloads were beginning very quickly, but then tapering off to only a few kB/s after a meg or two. E.g., a 50MB download will start at upwards of 600kB/s, but after a few moments will start stalling and eventually end up crawling along at 3-4 kB/s.
Some other users reported similar behavior on Win7 boxes, and fixed it by disabling Windows TCP Autotuning. I'm not sure of exactly what behavior this disables, though, or what its Linux equivalent would be. I have already reduced the MTU down to 1400 (from 1500) just to see if that was the issue, but it didn't have any effect.
Running a speed test on a nearby Windows machine shows 12Mb/s available both up and down, so it's not a matter of there not being enough upstream for the ACKs.
Google turns up a lot of people reporting similar problems, but the typical response is to blame it on ISP throttling, which it definitely is not in my case. (Both because I know the connection isn't throttled or shaped, and because I can download the same file on a Windows box and get a much higher sustained transfer.) It definitely seems to be some sort of maladjusted TCP setting. I'm comfortable with Linux but have never had reason to do much TCP tuning before.
Technical details: The test machine is running Fedora 16 (linux 3.1.0-7.fc16.i686 SMP). I can get the same result regardless of what server I'm pulling data from; I've seen it from a variety of Fedora mirrors but also via SCP from a machine at home. It's been a while since I've babysat one of the Linux boxes while it was doing an update, so I'm not sure for how long the issue has been going on. Nothing on the LAN side has changed recently; the edge router and switch are both a few years old and otherwise work fine.