Linux's awesome and underused traffic control facilities
serverfault.com
serverfault.com
Way back, I found I had two problems - if I was doing something that did a lot of uploading (eg seeding a torrent), my download speed would tank because the tcp/ip packets were bogged down in the upload queue.
I also like to be able to ssh into my machine while away from home, and if I did that while uploads were going on, the ssh terminal was basically unusable.
Back then I discovered tc - it was able to make TCP control packets (ack's etc) and ssh related packets jump to the head of the queue, and the other upload stuff have a lower priority.
Looking back at the script I created now, I don't really understand what it is doing, but it remember it worked. I still run it today and just take it for granted.
I tested it by start a large upload while ssh'ed into the box from the internet - I turned off the tc rules and the terminal became unusably laggy, and then I turned the rules on and it worked perfectly.
That being said, mosh is rather cool ^_^
ifconfig has technically been deprecated in favour of ip for about 8 years.
In any case, resource control on Linux is very very good these days. From traffic control to control groups (you can also manage tc classes in control groups too), its worth any system administrator having things like tc and cgroups in their arsenal so that the operating system controls the applications / users and not the other way around.
A pain in the ass compared to other CLI interfaces I agree, but I personally place resource management high on my things to know about, in the same way I put access management and storage management there too.
I can’t say the same for tc, which I tried to get into multiple times and failed. I will try it once more with your good explanation and understandable example. Thanks!
So yeah, the script is very small. But why is it? Because aliases are used everywhere. Over simplifying things. When you read it, you don't know what it does. When you read the 3 pages of explanations, you get the idea, but you still don't know exactly what it does.
At least with iptables you do. And you can match virtually anything (like a bit in a packet if you like)
The real interface issue is TC.
lartc.org was the bible we used to traverse the path of achieving control and command the precious resource called bandwidth. Those days are long gone, but building that small product gave me a chance to learn about networking like never before and taught me a lot.
I owe a lot to lartc.org
Why are there no consumer firewalls with great defaults for this? How fantastic in the era of cloud storage and network backup to have long-running uploads not clobber normal traffic.
This is also why openwrt only runs sensibly (if at all) on the more expensive boxes.
it is almost always better to just pay for bigger pipes.
It's it well known and heavily used.