FairQ ALTQ for PF - Patch #2
Matthew Dillon
dillon at apollo.backplane.com
Sat Apr 5 15:20:25 PDT 2008
After looking at WFQ (thanks to Max Laier for the reference!), and
reading a few papers on it, I've got the second version of my fairq
patch for ALTQ ready to go.
fetch http://apollo.backplane.com/DFlyMisc/fairq02.patch
This version removes the bitmap and the fixed array scan. It keeps
the fixed array of buckets but links the active buckets together into a
circular queue.
The 'hogs' option is now operational. This option allows a bucket to
drain in a burst (i.e. to not advance the round robin pointer) as long
as its bandwidth is less then the specified bandwidth.
My fair share scheduler is not yet weighted, but the new topology
makes it possible to implement a full blown fair share scheduler
(aka a weighted scheduler). I haven't decided whether I want to go
that far yet but in the mean I did implement a quick hack to
insert new empty low-bandwidth queues (bw < hogs bw) at the head of
the circular list instead of the tail (kind of a poor-man's deadline
mechanic but not really). I'm considering my options. The new
circular list gives me a lot of flexibility.
Here is an example configuration. Also note that your kernel must
be compiled with the various ALTQ options, including the new
ALTQ_FAIRQ option.
-Matt
ports="{ 22, 25 }"
altq on vke0 fairq bandwidth 500Kb queue { normal, bulk }
queue bulk priority 1 bandwidth 100Kb \
fairq(buckets 64, hogs 25Kb) qlimit 50
queue normal priority 2 bandwidth 400Kb \
fairq(buckets 64, hogs 25Kb, default) qlimit 50
pass out on vke0 inet proto tcp from any to any \
keep state queue normal
pass out on vke0 inet proto tcp from any to 216.240.41.28 port $ports \
keep state queue bulk
More information about the Kernel
mailing list