Good Ol' tc
August 31, 2005 by Eric Richardson
For the last few years I've run the USC waterski team. This year I've finally acknowledged that I'm way too busy to do a good job at that and have passed it off to someone else. I still have a good number of connections to the team, though, one of which is the fact that the mailing list still runs off my email server.
That just sort of dawned on me tonight when the new president sent out an email to the list that had 4mb of attachments. Or rather I should say he's still sending it, since qmail-qread shows it about 50/50 between done and not done for the list's 350 or so members.
Each time something like this happens I have to refigure out how to set up traffic shaping. Today the answer was to rate limit traffic destined for port 25 (SMTP) to 300kbit. :
sudo /sbin/tc class add dev eth0 parent 1:1 \
classid 1:12 htb rate 200kbit ceil 300kbit prio 0;
sudo /sbin/tc qdisc add dev eth0 parent 1:12 \
handle 12: sfq perturb 1;
sudo /sbin/tc filter add dev eth0 protocol ip \
parent 1:0 pref 2 u32 match ip dport 25 0xfffe \
flowid 1:12
I have no clue if that's the proper way to do it, but it's working. My pings have gone from 1200ms back down to a more fun 80 - 100ms.
My plan is to bike to church [again](http://blog.ericrichardson.com/blog/1916) this evening, though this time on [a much nicer set of wheels](http://blog.ericrichardson.com/blog/1918). All of this cycling has made me really wish for a bike routing site that did a few more things than [bikemetro](http://bikemetro.com) does.
I bought my new bike today. All summer I've been sort of building toward it, and I've been telling everyone that what I wanted for my birthday was a little money toward its purchase. Well, I don't quite have all the money together yet, but this was the time to buy and I went for it. End of summer just happens to be when the model year transition occurs, so all the 2005 bikes are on sale to make room for the new ones that'll be arriving soon.
