Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Playing with fq_codel in 2.4

    Scheduled Pinned Locked Moved Traffic Shaping
    1.1k Posts 123 Posters 1.7m Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mind12 @Ricardox
      last edited by

      @ricardox You also have 10240 configured for the limiter not 20480.

      Can you achieve your max speed with such a low queue lengths?
      I lost about 15Mbit/s from my 150Mbit download even with a 10K queue length.

      Why is the gateway empty for the In queue fw rule? I thought it's a must.
      And what's that 100 Weight for in the child queue? Never saw that elsewhere.

      Thx

      Z R 2 Replies Last reply Reply Quote 0
      • Z
        zwck @mind12
        last edited by

        @mind12 is there a general rule of thumb how to choose target interval quantum limit and flow ?

        M R 2 Replies Last reply Reply Quote 0
        • M
          mind12 @zwck
          last edited by

          @zwck
          Idk, I have just used the same working config as others here from this post: https://forum.netgate.com/topic/112527/playing-with-fq_codel-in-2-4/815

          1 Reply Last reply Reply Quote 0
          • P
            Pentangle @andresmorago
            last edited by

            @andresmorago Check out your floating firewall rules in/out pipes - are they switched?

            1 Reply Last reply Reply Quote 0
            • R
              Ricardox @mind12
              last edited by

              @mind12 For my 200/100 MB network I have no loss of speed. X86 PC

              1 Reply Last reply Reply Quote 0
              • R
                Ricardox @zwck
                last edited by

                @zwck I believe not, change the values and test, for my network these values work well.

                Z 1 Reply Last reply Reply Quote 0
                • Z
                  zwck @Ricardox
                  last edited by

                  @ricardox whats your advertised line speed?

                  1 Reply Last reply Reply Quote 0
                  • KOMK
                    KOM
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • T
                      TheNarc
                      last edited by

                      I don't mean to hijack the thread, but has anyone else seen any catastrophic issues with adjusting fq_codel parameters since upgrading to 2.5.0? I was playing with one of my systems that had limit and flows both set to 1024. The consensus - as much as there is one - seems to be that 10240 and 20480, respectively, may yield better results so long as you're not memory constrained. I have 4GB and it was rarely more than 20 to 30% utilized so I thought I'd try.

                      Now, for full disclosure, there was some negligence on my part and I was following @andresmorago's post which accidentally had these values flipped (so 20480 for limit and 10240 for flows). When I set those values and applied, the pfSense system became unresponsive (even to pings). I eventually had to resort to hard powering it off, but it didn't come back when I turned it back on either. So I connected a monitor and was able to observe that at some point in the boot process, it began rapidly spamming the period character (.), and did so at such a rate that it was impossible to view the last boot message before this happened. If I were better versed in FreeBSD I may have known what to do to glean more useful information, but I had unhappy users so I just resorted to doing a fresh 2.5.0 installation and restoration of a config backup.

                      Also of note, after that config backup, I threw caution to the wind and tried to update the parameters again, but this time to limit 10240 and flows 20480. That time, which I clicked apply, the system spontaneously rebooted. It did come back, and the new values had been applied, but I don't know what happened there.

                      So this isn't really a support request, more just wondering if anyone else has seen any weirdness along these lines. I'm wary of adjusting these parameters any more now as well lest I need to perform a full reinstallation again. I also can't directly implicate 2.5.0 specifically here, although I believe this was the first time I changed the fq_codel params since upgrading, and I know that prior to the upgrade I had done a lot of experimentation with changing them without any issues.

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        Pentangle @TheNarc
                        last edited by

                        @thenarc Not seen anything like that, but I was aware that the traffic shaping in earlier pfSense instances could play havoc with the connection if it changed for some other reason. I have recently built a v2.5.0 fresh instance and configured it with FQ_CoDel with no issues.

                        T 1 Reply Last reply Reply Quote 1
                        • T
                          TheNarc @Pentangle
                          last edited by

                          @pentangle Thanks for the input. I'd feel better had I not seen the spontaneous reset after adjusting these parameters following a fresh install; although it was a fresh install plus a config restore, so perhaps I pulled in some invalid configuration along with it. Just didn't have the stamina at the time to re-configure everything from scratch ;)

                          1 Reply Last reply Reply Quote 0
                          • M
                            mind12
                            last edited by

                            I have applied the same settings for my 150/10 Mb connection but my download speed wont move above 130Mb. Upload is fine. Checked CPU usage also during the speedtest but it's fine abou 30% utilization at all.

                            These are my config, similar to @Ricardox 's:
                            Pfsense VM with Intel NICs 2CPU 4GB RAM (about 60% utilized)
                            All network hardware offload off because of suricata inline mode.

                            DownLimiter:
                            147Mb, Tail Drop - FQ_CODEL (5,100,300,10240,20480), Queue 10000, ECN off
                            DownQueue:
                            Taildrop, ECN off

                            Any idea/tweak I could try?

                            R 1 Reply Last reply Reply Quote 0
                            • R
                              Ricardox @mind12
                              last edited by Ricardox

                              @mind12 Installed Open-VM-Tools? For my 200/100 MB network I have no loss of speed. X86 PC!
                              realtek gigabit network cardVelocidade.jpg

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                mind12 @Ricardox
                                last edited by

                                @ricardox
                                Sure, without the limiters I get maximum speed too.

                                F R 2 Replies Last reply Reply Quote 0
                                • F
                                  fabrizior @mind12
                                  last edited by fabrizior

                                  @mind12 @Ricardox

                                  I think I still have a bit off tuning to do... Any recommendations?

                                  Have Comcast 400/25 service.
                                  Getting ~380/23 with my limiter config and bufferbloat lags of 56ms/41ms respectively, but with max download bufferbloat lag spiking up to ~230ms.

                                  DSLReports SpeedTest (limiters on)
                                  DSLReports SpeedTest with limiters

                                  WANDown limiter @ 400mbit/s
                                  Queue: CoDel, target:5 interval:100
                                  Scheduler Config: FQ_CODEL, target:5, interval:100, quantum: 1514, limit: 5120, flows 1024, QueueLength: 1001, ECN: [checked]

                                  WANUp limiter @ 25Mbit/s
                                  Queue: CoDel, target:5 interval:100
                                  Scheduler: FQ_CODEL, target:5, interval:100, quantum: 1514, limit: 10240, flows 1024, QueueLength: 1001, ECN: [checked]

                                  EDIT: added detail with limiters disabled.
                                  Perhaps I should just turn them off??? Am I really getting any benefit?

                                  448/24 MBit/s and 51/67 ms bufferbloat with limiters disabled

                                  [DSLReports SpeedTest (no limiters)]
                                  DSLReports SpeedTest Results without limiters)

                                  SW:
                                  pfSense v. 2.4.5-RELEASE-p1
                                  pfBlockerNG-devel (2.2.5_37), ntopng, bandwidthd, telegraf
                                  Openvpn server active, no connections at time of test.

                                  HW:
                                  Protectli Vault FW6C
                                  Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
                                  Current: 2400 MHz, Max: 2601 MHz
                                  AES-NI CPU Crypto: Yes (active)
                                  CPU Utilization: ~5%
                                  Memory Usage: ~17% of 8GB
                                  Network HW Offloading: [edit] disabled enabled

                                  M T 2 Replies Last reply Reply Quote 0
                                  • M
                                    mind12 @fabrizior
                                    last edited by

                                    @fabrizior Hm if the latency wont go below 50ms with and without the limiters I don't see any reason to use them. In my setup despite the speed decrease with the limiters the latency is around 10ms.

                                    Sadly I dont know and have not found any info about those advanced scheduling parameters and how to tune them. Have you tried the values/config we posted?

                                    B P 2 Replies Last reply Reply Quote 0
                                    • B
                                      bobbenheim @mind12
                                      last edited by

                                      @mind12 you can read up on the various parameters here

                                      Besides that i don't believe that the field QueueLength does anything when using FQ_CoDel.

                                      F 1 Reply Last reply Reply Quote 0
                                      • R
                                        Ricardox @mind12
                                        last edited by

                                        @mind12 See the images of my configuration above, I am using fq_codel limiters.

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          TheNarc @fabrizior
                                          last edited by

                                          @fabrizior Out of curiosity, have you tied setting your download limiter bandwidth higher than 400Mbps? I only ask because my ISP recently doubled my download speed from 100Mbps to 200Mbps and I've observed some inaccuracy when I bumped my download limiter bandwidth accordingly. Specifically, when I tried setting it to just 200, the observed actual limit - over multiple tests using flent - was more like 150Mbps. Through many iterations of testing and upping the limit, I found that I had to set my download limiter's bandwidth to 240Mbps is order to achieve an actual limit of ~200Mbps. I can't explain why, but my test results are consistent.

                                          F 1 Reply Last reply Reply Quote 0
                                          • F
                                            fabrizior @bobbenheim
                                            last edited by

                                            @bobbenheim

                                            I'm still seeing bufferbloat lag latencies up to between 400-800ms as maximum spikes during testing with the averages being in the 50ms range. What would cause this to continue to occur?

                                            Also, and separately, that RFC says:

                                            5.2.4. Quantum

                                            The "quantum" parameter is the number of bytes each queue gets to
                                            dequeue on each round of the scheduling algorithm. The default is
                                            set to 1514 bytes, which corresponds to the Ethernet MTU plus the
                                            hardware header length of 14 bytes.

                                            In systems employing TCP Segmentation Offload (TSO), where a "packet"
                                            consists of an offloaded packet train, it can presently be as large
                                            as 64 kilobytes. In systems using Generic Receive Offload (GRO),
                                            they can be up to 17 times the TCP max segment size (or 25
                                            kilobytes). These mega-packets severely impact FQ-CoDel's ability to
                                            schedule traffic, and they hurt latency needlessly. There is ongoing
                                            work in Linux to make smarter use of offload engines.

                                            Is this still a current issue?
                                            Will test disabling TSO when I can take the interfaces offline.
                                            Should I also turn off LRO?

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.