Fairq - How to do?



  • Fairq is in it, but I'm a bit unsure how to properly use it. Especially because when I play around a bit, I get a trap 12 crash… Anyhow, thats something different.

    What I wanted to do - I wanted to use Fairq cause it's breaking up long flows (some heavy downloader). Then I had a ack queue and a higher priority one, for a separate network.

    The question - Should I also use floating rules to put everything in the right queue with Fairq? Or does it have some no-config mechanism like codel.

    I have a rule to keep my LAN interfaces from entering each other which is any any !interfaces. Could this maybe conflict the whole, therefore making it crash?

    Any help would be very much appreciated. Or just a example post of your ALTQ setup with FAIRQ working would also be more then helpfull.



  • And yes I found this example in the source, but here I'm wondering what is the purpose of the bulk queue. Is it just do have a lower priory que available to let fairq degrade to? Or is it really a specific port traffic range that is going separate in this queue?

    altq on em0 fairq bandwidth 650Kb queue { std, bulk }
      queue std  priority 3 bandwidth 400Kb \ fairq (buckets 64, default, hogs 1Kb) qlimit 50
      queue bulk priority 2 bandwidth 100Kb \ fairq (buckets 64, hogs 1Kb) qlimit 50

    pass out on em0 from any to any keep state queue std
    pass out on em0 inet proto tcp ….. port ... keep state queue bulk

    So if the last is true, is fairq also breaking up flows with only one queue?



  • @drbobo:

    Fairq is in it, but I'm a bit unsure how to properly use it. Especially because when I play around a bit, I get a trap 12 crash… Anyhow, thats something different.

    What I wanted to do - I wanted to use Fairq cause it's breaking up long flows (some heavy downloader). Then I had a ack queue and a higher priority one, for a separate network.

    The question - Should I also use floating rules to put everything in the right queue with Fairq? Or does it have some no-config mechanism like codel.

    I have a rule to keep my LAN interfaces from entering each other which is any any !interfaces. Could this maybe conflict the whole, therefore making it crash?

    Any help would be very much appreciated. Or just a example post of your ALTQ setup with FAIRQ working would also be more then helpfull.

    If you are looking to hinder a specific, heavy downloader there are better more predictable options, like limiting the maximum speed of the heavy downloader which can be done with FAIRQ, HFSC ("upper-limit"), and possibly CBQ. Applying FAIRQ to all traffic or a specific interface is not predictable because it's fairness is distributed among all flows (connections), meaning any single host can simply open many connections and get an "unfair" amount of bandwidth. Torrents are very guilty of this.

    Also, another good option may be to use traffic-shaping limiters and their dynamic bandwidth splitting among active IPs feature: https://forum.pfsense.org/index.php?topic=63531.0



  • Thanks a lot for your reply! The thing, I want to keep it all dynamic. So the sense of the internet speed is high with all users. I have 88 interfaces over a 500MBit line, where 10 have higher priority. So I was thinking let's use FAIRQ to schedule and CoDel to tackle the torrent people and such.

    But a simpler setup might be just a cbq with loaning on or still fairq with codel. And the limiters as suggested.

    But still it would be nice to know if you always need to make rules to put the queue to work in pf or not. Cause this is somehow vague. I like to know actually what I'm doing :)



  • @drbobo:

    Thanks a lot for your reply! The thing, I want to keep it all dynamic. So the sense of the internet speed is high with all users. I have 88 interfaces over a 500MBit line, where 10 have higher priority. So I was thinking let's use FAIRQ to schedule and CoDel to tackle the torrent people and such.

    But a simpler setup might be just a cbq with loaning on or still fairq with codel. And the limiters as suggested.

    But still it would be nice to know if you always need to make rules to put the queue to work in pf or not. Cause this is somehow vague. I like to know actually what I'm doing :)

    All unassigned traffic goes to the Default queue. Traffic must be assigned by a firewall rule into the non-Default queues.

    The pfSense book is $25 nowadays, which I very much encourage buying. https://portal.pfsense.org/members/signup/html-book



  • Already bought it and the book of PF as well. Very informative I would say. Especially the PF book. :)

    Is the default queue per interface or of whole ALTQ. Cause if I don't enable an interface is it going in a default queue? Or is it bypassing the traffic shaper.



  • So too sum it up!

    A good way would be using a simple priority queuing scheduler. For the following q's:

    qAck
    qHigh - Special users
    qNormal - Normal users
    qLow - Guest users ( a lot of mobile phones and such)

    Each with Codes on for lowering the ping problems and such.

    Then add a limiter on all traffic, to not have downloaders saturating the link.

    Still think Fairq would be better then Priorty or CBR cause it keeps everything more dynamic.

    Or any opinions?



  • @drbobo:

    So too sum it up!

    A good way would be using a simple priority queuing scheduler. For the following q's:

    qAck
    qHigh - Special users
    qNormal - Normal users
    qLow - Guest users ( a lot of mobile phones and such)

    Each with Codes on for lowering the ping problems and such.

    Then add a limiter on all traffic, to not have downloaders saturating the link.

    Still think Fairq would be better then Priorty or CBR cause it keeps everything more dynamic.

    Or any opinions?

    I don't think that's optimal, but you can always try it and find out.

    Here's my favorite QoS tutorial: http://www.linksysinfo.org/index.php?threads/qos-tutorial.68795/