September 15th 2007

Why does using all the upstream cause lag?


It's a common story. A housemate starts torrenting some American television series of dubious artistic quality and/or legality, or perhaps starts calling their girlfriend on Skype and your SSH sessions start to lag. Why does this happen?

When the upstream channels become saturated, data must overflow into the modem's buffers. This causes TCP acknowledgement (ACK) packets originating from your SSH client to be delayed, resulting in an increase in the overall round trip time. This phenomena is usually worse on cable connections as their modems' buffers are generally larger.

Avoiding the problem can be pretty simple - limiting your upstream bandwidth just below its maximum helps, and some smarter solutions involving prioritising ACK packets work even better. Although these are best achieved at your router, a number of applications have their own limiting features: every BitTorrent client will have one, and other tools such as scp (via the '-l' option) have them too.

You can subscribe to new posts via email or RSS.