pfSense English Support > Traffic Shaping

Download bandwidth belonging on same queue not evenly shared between computers



Currently i'm using pfSense 2.4 as my home router on a physical machine with motherboard Asus E35M1-M (it has integrated CPU AMD E-350), 8GB DDR3 ram, an SSD Disk and Intel PRO1000 Dual Port network card.

I have not managed to setup correctly Traffic Shaping so i only use Limiters (as shown on in order to evenly share bandwidth between devices. I have enabled fq_codel on limited as shown at the first page of the mentioned topic.

I have setup a testing pfSense 2.4 installation on a Virtual Machine in order to perform there my tests for Traffic Shaping. Some of my traffic shaping settings and firewall rules,  are shown at the screenshots.

When i am downloading a torrent it goes to the qP2P queue. If no one is downloading something with higher priority, then the torrent gets full speed. If someone tries downloading something with higher priority, then the torrent speed is lowered and the high priority download gets the expected speed.

Now when i start an HTTP download, which goes to qOthersHigh queue, it gets full speed. When i start another HTTP download from another computer, which eventually goes to the same queue, speed is not evenly shared between those two computers. Most of the times the computer that first started downloading gets the most speed (about 2.4 MB/s in my case) and the second one gets about 1.1 MB/s. Sometimes the opposite happens and the second computer gets the most speed. In any case speed is not evenly shared between computers.

The rule that assigns HTTP downloads to the relevant queue is at screenshots down_05_rule_01.png and down_06_rule_02.png . It is not a floating rule. I have also tried a floating rule with Action: Match but i have exactly the same results.

The only way i have found to evenly share the speed, is to assign at the rule the In/Out pipe i'm using on my production pfSense. But also in that case i have strange behavior:
When the two computers download one file at a time the speed is shared evenly between them. When any of the two computers starts downloading a second file, that computer gets more speed. If it starts a third download then it again gets more speed. So the speed is no more evenly shared between them.

I have tried lowering down the queues and limiters sizes (to 85 instead of 500 as at screenshots) , increasing them to 1000 but i have exactly the same behavior.

I have also upgraded to the latest 2.4.3 snapshot, no luck unfortunately.

Also instead of using Limiters at the firewall rule, I tried enabling Codel Active Queue at all of my Upload and Download queues but I do not have the expected results.

Does anyone have an idea why all that is happening and how can i solve it?

Thank you in advance!

The default queue type for normal shaping is a FIFO queue, which are horrible at distributing bandwidth among flows. Enable Codel Active Queue for the queues you care about keeping latency low and bandwidth more evenly distributed.


--- Quote from: Harvy66 on November 20, 2017, 10:53:41 am ---The default queue type for normal shaping is a FIFO queue, which are horrible at distributing bandwidth among flows. Enable Codel Active Queue for the queues you care about keeping latency low and bandwidth more evenly distributed.

--- End quote ---

I have tried your suggestion and enabled Codel Active Queue , both at WAN and LAN, at the following queues:

I have cleared the states and restarted the router many times but the results are still the same.

The only case that the speed is almost perfectly shared evenly the way i want, is if one computers downloads something that goes to queue qOthersHigh and the other one to qDefault (i have mentioned randomly those queues) . In that case no matter how many simultaneous downloads one computer runs (i have tried up to 8 simultaneous), the other computers gets most of the time the half speed.

Do you have another suggestion?

How much bandwidth did you assign qDefault? I don't actually see it in the images or mentioned anywhere.

I think one way to solve this problem might be to use limiters with multiple queues and weights on the queues to limit the amount of bandwidth one machine can consume.

For example, assuming you had two machines, you could use limiters and create two queues (let's call them queueA and queueB) under your upload and download limiter and assign each a weight of 50.  Then create the necessary firewall rules to pass traffic from machine 1 through queueA and and traffic from machine 2 through queueB.  This should ensure that each machine will get a least 50% of the bandwidth and more if the other machine is just idle.  I've got a similar setup to this, but it's done by subnet rather than by machine/host (i.e. to ensure each individual subnet gets at least a certain % of bandwidth if the connection is loaded down).

A further option would be to use multiple limiters with multiple queues.  For instance you could create an upload and download limiter for machine A and an upload and download limiter for machine B and limit the bandwidth of each set of limiters to 50% of your connection speed.   Then underneath those limiters you could create queues to prioritize your traffic.  While this allows for easier prioritization of traffic in multiple queues, the downside is that machine A and B will see no more than 50% of your bandwidth vs. the full bandwidth if the other machine is idle.  That would be the tradeoff.  Note that you can still use weights on your queues in this approach as well if you wanted to guarantee bandwidth on certain types of traffic on a given host (e.g. P2P vs. HTTP, etc.)

I realize there are limitations to these approaches, and if you have many machines then it's probably not practical.  There might be more elegant solutions out there, but unfortunately I'm not aware of an easier way to share bandwidth equally between hosts whose traffic all goes through the same queue (vs. setting up multiple queues).

Hope this helps.


[0] Message Index

Go to full version