Why upgrading your Linux Kernel will make your customers much happier
samsaffron.com
samsaffron.com
I once peevishly pointed out that if you weren't required to stop at stop signs your commute would go faster, but if nobody was required to stop at stop signs it would be slower because every other intersection would have an accident blocking the way.
This is also very much true of TCP congestion control algorithms. And while a few people not using them can get away with it, everyone not using them and you will find your network latency goes from a median with a low standard deviation, to a slightly lower median with a HUGE standard deviation.
One of the things that slow start does is it spreads the change in median latency over a longer period of time. You can think of this intuitively where each new connection starts slow and then gradually gets faster, until it is as fast as it can be, and as more people start connections they start slow and get faster, while the current connections get slightly slower to accomodate the new traffic. The result is a non-chaotic adjustment of the network flow.
The converse is that everyone starts out going as fast as they can, they not only overwhelm the node the node ends up getting massively congested for a moment trying to sort things out. And of course IP doesn't care if you lose a fragment, you'll eventually resend it. So now during this massive congestion the re-transmits are causing more congestion. You get lots of pushback and finally everyone is back to a level where the network is doing ok with it and wham! a new connection opens up and everyone gets hosed again and backs off again, and then ramps up again.
Moral of the story, if only you don't do slow start you can be fast, if everyone doesn't start slowly, the network latency gets really unpredictable and poor.
[1] Jim Gettys and his bufferbloat posse might have something to say to you though.
Like someone said in the comments on the article, I'd like to see Van Jacobson's or someone similar's thoughts.
Balancing these requirements against each other is a really hard problem. TCP slow start is (well, was, c.f. this article) an early attempt to get an auto-tuning solution. But it isn't the only part of the problem, nor is it an optimial (or even "good") solution to its part of the problem. It's defaults are very badly tuned for modern networks (though they'd be a lot better if everyone was using jumbograms...).
As far as I can see, nobody is recommending that. This isn't about getting rid of slow-start. They're just talking about tuning the initial window to be larger.
If you were writing this algorithm today, you would look at the value for the window that most systems end up on and then pick an initial value just slightly below or equal to that. I doubt that number would be 2.
While we're modifying the initial constant, why not reconsider the exponent? Or the shape of the equation itself?
There's quite a bit of research[1] in the area and it seems for most applications you can indeed get away with quadradic or basically any superlinear backoff algorithm.
However, most of the work I've seen was based either on synthetic models or tested only on smallish networks under artificial congestions. It's hard to predict how it will cope at internet-scale when theory meets broken vendor-implementations.
[1] http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=5766...
On the other hand, we have so much more bandwidth now. 56kBd is a fart in today's gale. Of course we shouldn't start out at full throttle, but the factor of 5 he's endorsing is virtually nothing and it still gives a higher proportion of overhead than we had back then.
So you can start slowly, but time isn't necessarily the axis along which your start is "slow" or "fast." I am really interested to see whether the above or a similar protocol will be able to spread out "slow"-start over an axis of window sizes that the protocol probes for. Then maybe we will be less concerned with who gets to decide what the initial congestion window is, because you can't ramp up too "fast" when you know what to ramp up to.
4-way stop sign junctions were probably the most asinine, time-wasting, fuel-wasting road control I found when I drove in the US.
Once you get to multiple lanes, the answer is simple: both roundabouts and 4-way stops are inferior...
I cannot find a roundabout design that fits into that same space. Looking at the Wikipedia entry[1], it seems much larger than a standard 4-way. Given the block patterns in American suburbs and housing developments, the extra space would eat into someone's yard.
A road with two lanes in either direction would normally be major enough to warrant traffic lights; or, if it's just a particularly wide suburban road, then the lane closest the pavement is often used for parking, and the road would narrow to one lane (with advantages in reducing speed somewhat) for a roundabout.
I don't usually post in all caps here, but many readers, myself included, will sometimes go to HN comments first to get a TL;DR version of an article. The thoughtful rebuttals by po and sams99 can easily be overlooked by people in a hurry. I think it's too late to edit or delete the parent comment, and the "flag" function is for spam and uncivility, not for carelessness.
As po and sams99 pointed out, the article is not about not doing slow start. It's about tweaking slow start parameters. This particular tweak has been adopted by the Linux kernel authors and others who do understand why TCP slow start is important.
But lets think about that from the other side for a moment. Most systems will end up with a congestion window size of 1452 because their router has an MTU of 1500. With a CW of 2 that is 3000 bytes blasted out waiting for an ack (even though its only 2904 data bytes the MTU constraint will fragment it into two 1500 byte packets), with a CW of 10 that is 15000 bytes blasted out initially.
Lets say everyone on Comcast's network gets this change, they have an estimated 15 - 20 million subscribers. We'll be conservative and call it 15 million, and at any given time maybe half of them are doing an HTTP request (think about all the things that do HTTP requests in your house for a moment). So at any given instant in time you've gone from blasting out 3000 * 7.5M or 22.5GBytes (or 225 Gigabits) to 112.5GB or 1.125 terabits of data. Not surprisingly a lot of their traffic goes to some peering network and now their hammer is hitting with Terabit whacks instead of 200 Gigabit whacks. That is a noticeable change, and its an even bigger change when you consider they are running VOIP traffic as well.
Some useful work to be done here is to look at where the congestion window settles out on your network. And for what servers. And for which transit networks. How often does it get to 10? 20? The worst case would be it settles at 16. That's because with an IW of 10 the next window is 20, and then you get clamped.
There has been a lot of great work done on congestion control, and yes its really annoying like metering lights[1] when its not needed. But when it is needed it makes the system work.
Congestion is a function of cross section bandwidth and traffic demands. The cross section bandwidth of the Internet has gone up a lot, the number of 'ports' on the Internet has gone up even more. The ratio, has not improved much (and in some cases gotten worse) from the days of dial up.
I fully recognize that a number of people have done the same test (or thought experiment) the author has done with slow start and seen a green field for improvement. I was reasonably active in the IETF before the work on congestion was implemented, with a protocol that could be very latency sensitive (NFS), and it was a hellish environment. My disagreement, is that changing slow start in this way will destroy a number of interesting streaming services by increasing the standard deviation on latency outside of what they can tolerate. And for what? So that a 34K web page loads 30% faster? I'd much rather compress the web page or build a web service protocol that knows about slow start and accommodates it than this.
As others have pointed out, this change is going to happen regardless, and perhaps I'll have the opportunity for an 'I told you so', or perhaps I'll be relegated into the dustbin of ranting network dudes from the last century. But I stand by my TL;DR that the author did not demonstrate an appreciation for the impact of changing slow-start would have on the network in general because they focused only on how it would make their life faster.
[1] Here in California we have congestion control 'metering' lights on some on-ramps to the freeway, its annoying as hell when they are on and there isn't anyone on the freeway.
Does it matter only server side, or do clients benefit of having this window increased too?
Also, a comment of the article mentions this:
Why are you talking about upgrading the kernel, when you can simply do:
ip route change default via MYGATEWAY dev MYDEVICE initcwnd 10
which would be similar to the netsh tunable on Windows. So upgrading the kernel is only needed to have it set to 10 by default.EDIT:
It seems Mac OS X is using either NewReno or LEDBAT instead of the mentioned CUBIC or Vegas. Look for tcp_ledbat_cwnd_init in [1] which looks quite simple, or tcp_newreno_cwnd_init_or_reset in [0] which looks a bit more involved:
/* Calculate initial cwnd according to RFC3390,
* - On a standard link, this will result in a higher cwnd
* and improve initial transfer rate.
* - Keep the old ss_fltsz sysctl for ABI compabitility issues.
* but it will be overriden if tcp_do_rfc3390 sysctl is set.
*/
PS: xnu-1699.24.23 is Lion 10.7.3[0] http://opensource.apple.com/source/xnu/xnu-1699.24.23/bsd/ne...
[1] http://opensource.apple.com/source/xnu/xnu-1699.24.23/bsd/ne...
Tuning and Testing the FreeBSD 6 TCP Stack (2007) http://caia.swin.edu.au/reports/070717B/CAIA-TR-070717B.pdf
For 99% of web browsing, the client's request fits in one or two segments and so would not benefit from the change.
That said, thanks for the post, and I'll definitely be tcpdumping in the upcoming week and reading some more about slowstart!
Maybe testing with net.ipv4.tcp_slow_start_after_idle 0 vs 1 would make a cleaner comparison?
There were a slew of TCP changes leading up to the 3 branch which included changing the default congestion control algorithm to cubic.
slow start after idle does not really play part here. The test is for a clean/new connection.
I am no expert but it is possible I could lower my IW on my 3.2 box to 3 to demonstrate the same pattern, however that too is not a clean comparison.
If my sys admins push me I may set up another VM to demonstrate this.
Installing "linux-image-generic-lts-backport-oneiric" outta do it.