11.02
So after much trial and error I finally have queueing set up on my home network!
Most people on asynchronous DSL connections like mine use queues to prioritize TCP ACK packets. As I’d said before my DSL seems unaffected by that particular issue which is interesting in and of itself because it seems to indicate that 1) my DSL is a fatter pipe than they advertise and 2) the bandwidth limiting is happening farther upstream and TCP ACK packets are being prioritized there.
Well that’s all well and good, but I recently discovered that during a large upload (*cough*bittorrent*cough*) my SSH sessions became laggy and generally a pain to use… and we can’t have any of that.
Enter ALTQ
I set up altq on my firewall with two queues:
altq on $ext_if priq bandwidth 327Kb queue { q_pri, q_def }
queue q_pri priority 7
queue q_def priority 1 priq(default)
This is a pretty vanilla queue set up, two priority queues one high and one default and a bandwidth setting at 327Kb. That’s important, that bandwidth number, but we’ll come back to that.
Then we add stuff to our queues like so:
pass out on $ext_if keep state queue (q_def, q_pri)
And voile, we’re pretty much done.
When you specify two queues the second one is used for packets with a “lowdelay” TOS and TCP ACK packets with no data payload and so in this case we’re assigning them to a higher priority queue, see?
Now there are plenty of examples around the net showing special queues for SSH traffic, but with SSH (at least OpenSSH) interactive traffic is set to lowdelay by default so there’s nothing more to do, it gets placed in the higher priority queue.
It’s the bandwidth, stupid
Where I had screwed up early on was in the bandwidth setting. See, queues only work when there’s something actually queued (imagine that) so basically you’ve got to be approaching your maximum bandwidth to see any effect. When I first started messing with queues I set the bandwidth to 350Kb or 91% of my 384Kb/s upload speed since that was my demonstratable maximum upload speed. That was too high and the queues were ineffective.
I dropped it to 338kb thinking that surely 88% would be good. I mean I see issues at speeds above that so surely it must be a good speed to kick in at. I could see improvement, but there was room to do better.
Finally, at 327kb, or 85% of my maximum upload speed, things hummed along, even at full tilt on the upload side. Now I can SSH to my heart’s content with my bandwidth is pegged.









