FQ_Codel vs FQ_Pie

Started by Siarap, March 09, 2025, 03:00:09 AM

Previous topic - Next topic
March 09, 2025, 03:00:09 AM Last Edit: March 09, 2025, 03:21:39 AM by Siarap
Its not HOW TO but its informational topic. I get much better results with my hybrid fiber-coaxial (docsis 3.0) modem when im using flow queue pie than flow queue codel. With fq codel i need to waste 20% of my bandtwith for good bufferbloat results. With fq pie i waste 3% for sqm, and have better results than with fq codel. Anyone can tell me what results achieve with fq pie? Im using "Enable PIE"(linux man pages says thas fq pie uses pie by default but i have different results with that option enabled), and "CoDel ECN" on download only (ecn setting works for fq pie when fq pie is used). Increased FQ-CoDel flows to 4096 (it works as fq pie flows when fq pie is used) but i must WARN you. Increasing flows requires reboot (flows are alocated in ram during bot time) but if you increase them to much you can brick your router because it consumes some ram. Im using 4096 now for 8 gig of ram on router. Tune your target and interval as is described here : https://docs.opnsense.org/manual/how-tos/shaper_bufferbloat.html Pie uses many codel parameters but has different defaults. But i dont know do its implemented in opnsense to control this parameters for fq pie. Just tuned it as codel and have much better results than with fq codel. Fq pie is implemented as default queue mechanism in docsis 3.1 standard. Docsis 3.1 is described as low latency docsis.

You can try it and share your results.

EDIT: I must say that my results may be different each time i test bufferbloat. I have low quality isp with no guaranteed speed. My max bandwith fluctuates. On weekends i have always worse results than during week.

March 20, 2025, 09:14:46 AM #1 Last Edit: March 20, 2025, 01:03:07 PM by Schnuffel2008
Hi,

thanks a Lot for your posting. I have found the same findings that you've posted here. I've spend a Lot of time trying to find the optimal settings for fq-codel and ended Up with 530mb Download and 250mb Upload in my 600/300 Internet Connection. The bofferbloat results in Waveform bofferbloat Test gave me Most Times a a+ but Sometimes also only a a Grade with 5 - 10 ms more latency in Download and 0 MS in Upload with fq-codel. When i Change to pie I only enable "Codel-ECN" and " pie" in Download and Not in Upload and leave all other fields to Standard and even leave flow to Standard I have 585MB for Download with 1ms and 292 and 0ms for Upload. The results we're differently when I compare tge bofferbloat for different testplatforms one ookla Speedtest or devina.io but at the Moment I have to say that I am very Happy with the results especially thonking of the Minimum waste of time to have such a good result without the need of optimizing all the different parameters thatfq-codel offers.
But of ciurse this ist only a first Impression after a few hours.

March 20, 2025, 12:36:39 PM #2 Last Edit: March 20, 2025, 12:38:28 PM by Seimus
The FQ_Pie config works similar to FQ_Codel.
Both of them contain the Pie or Codel already in them.

When you enable PIE or CODEL in a Queue you are running it on a top of FQ_Pie or FQ_Codel.
Basically FQ_Pie and FQ_Codel when turned on are seeded in a Scheduler, where Pie or Codel are situated in a Queue. By using both together you actually create a overlap. Enabling Pie or Codel in Pipe has no effect if you use manually created Queues.

Rule > Queue (PIE or Codel) > Scheduler (FQ + Codel flows or Pie flows; flows represent 5-tuple dynamic sub-queues created in Scheduler) > Pipe

This can cause undesired outcomes, because the Pie or Codel in Queues fights about control with the Pie or Codel in the Schedulers dynamic flows.


Also the fact you got better results when using FQ_Pie vs FQ_Codel in test scenarios is not surprising. Both Algorithms have their usage and benefits. However a test scenario will not cover real life usage. I have tested for example that FQ_Pie gives me better results during testing than FQ_Codel but in real case scenario its worse.

The real live scenarios for each of them if we keep it simple:
Pie   
- Probabilistic, gradual
- Usage in ISP networks, broadband, general traffic

Codel
- Adaptive, based on packet age
- Low-latency applications, real-time traffic

Overall FQ_Codel better adapts to BW fluctuations than FQ_Pie.

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD

March 20, 2025, 01:39:10 PM #3 Last Edit: March 20, 2025, 07:14:18 PM by Schnuffel2008
Hi Seimus,
thanks you very much for your reply. I have to say that I am only an Hobby User and not so familiƤr with the things you have written.
When I switched to Opnsense some years ago I was very fascinated about all the possibilities this solution brings with vlan and all the other things.
But a problem was that I can't watch an Internet stream when someone else in the network startet downloading an iso-Image or another big File. The video always stutters.
After some research i found that traffic shaping is the solution and that bofferbloat was the problem. And the test sites like Waveform seems to proof this. And after optimizing the traffic shaper with fq-codel the problem was gone.
It seems to me, that you are an expert in this stuff and what I unterstand from your writin is that I've made a mistake in configuring pie because you have written that fq_codel and fq_pie was overlapping. I thought I've configured Pie without Codel.
So in the end our situation is that we are 4 users here and we use the Internet for streaming and data-sharing within our Family that belongs more to the pie scenario as you have written and for internet gaming and VOID that belongs to low latency and to fq_codel.
So what would you suggest in this case and what is the right configuration for pie without mixing it up with fq_Codel. I haven't found a good Instruction for using it. But I'll really want to try it but of course with the right configuration. After that maybe I can decide which one to use. But at the Moment I would prefer pie because of its easier configuration.

Regards

PS: I have to say that your post was even more helpful than I've already said before. With your comment that the configuration seem to be a mistake I've tried it again with fq-Codel. And here I've changed some of the paramters. In the past I've followed the instructions in the internet to reserve some amount of the bandwith to the pipe and so I've reduced the bandwith from 600 to 550 and from 300 to 270. After that I've tried to optimize all the other parameters for quantum and limit and so on belonging to instructions I've found and with try and error. After a while I've thought I've found the optimum and with these settings I get the results I've posted before. Now I've tried it without thinking of all the informations I've had before and changed the settings for shaper to
Donwload: Bandwith: 600MBit, Queues: 3  ( I don't know if this is really the best solution), Scheduler type: Flowque-CoDel, Codel_ECN Enabled and I left anything else empty. 
Upload: Exactly the same thing despite 300MBit Bandwith. Now I have 580MBit for Download and 290Mbit for Upload in Ookla Speetest and Grade A+ with no latency lost in bufferbloat test at waveform. I've tried to watch a stream and make 3 Downloads in parallel and have seen no stuttering. So at the moment these are fantastic results with this so simple configuration (Hope that nobody will tell me that this configuration isn't valid too :-) .
I don't know why it works for me without reducing the bandwith as I've been told in so many postimgs in the internet. Maybe it will work only for today but I will give it a try for the next time.

The configuration sounds right to me, if you don't use manually created Queues e.g you didn't configure any queues in the Queues TAB.
The Queues option in Pipe TAB creates dynamic queues, so if you put number 3 there it creates 3 queues to which you can set rules. If you however create manual queues in the Queues TAB, than this option in Pipe is not needed. You need at least 2 at minimum one for Download one for Upload.

The default parameters for FQ_C should mostly work out of the box, and mostly you don't need to change it. Main parameter to tune is the BW. It can as well work with changing/lowering the BW. This actually highly depends on your ISP, if your ISP is constantly capable to deliver you your contracted speeds and doesn't have a bottleneck somewhere it will work without problem.


The overlap I mentioned, I ment
You can set FQ_C in a scheduler and CoDel in Queues TAB. This should be avoided because its overlapping. Same goes for;
You can set FQ_P in a scheduler and Pie in Queues TAB. This should be avoided because its overlapping. Same goes for;
You can set FQ_C in a scheduler and Pie in Queues TAB. This should be avoided because its overlapping. Same goes for;
You can set FQ_P in a scheduler and CoDel in Queues TAB. This should be avoided because its overlapping.

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD