pfSense Gold Subscription

Author Topic: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube  (Read 1293 times)

0 Members and 1 Guest are viewing this topic.

Offline PCbuilder1997

  • Jr. Member
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
I have been plugging away at this for a few days now. I cannot seem to figure out the correct parameters for traffic shaping. I stream content to twitch whilst playing games for an average of about 6 hours a day. My fiancee needs something to do in those six hours. When i stream she either watches netflix or youtube. But when she does I get some latency issues and some lost packets. I have tried all 4 forms of traffic shaping with different settings (just random parameters, trying to get things to work). The most success i have reached has been using CBQ. I am a NOOB when it comes to traffic shaping. I used the wizard "traffic_shaper_wizard_multi_all.xml" to set up CBQ and under the Games child i have it set for 40% bandwidth. Twitch is not a P2P service so that is set at 5%. I do not know what qACK is so i left that at the default percentage of 15%.
Please let me know if i need or can provide more information. I really would like to figure this out. My ISP is Comcast wouldn't be my first choice, but they are the best option for my area (they kinda blow chunks).

Offline Chrismallia

  • Full Member
  • ***
  • Posts: 259
  • Karma: +20/-4
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #1 on: September 24, 2017, 01:19:34 pm »
Try to run the wizard HFSC and enable codel on all queues

Offline PCbuilder1997

  • Jr. Member
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #2 on: September 24, 2017, 01:44:31 pm »
I will try this. I start my stream in a few hours. Thank you in advance!
I will update this as soon as i know

Offline Harvy66

  • Hero Member
  • *****
  • Posts: 2209
  • Karma: +204/-12
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #3 on: September 25, 2017, 07:36:50 am »
If it still doesn't work, use FairQ as your shaper, set your interface to 90% of your actual speed, have one queue on your interface, make sure it's the default and enable Codel on it.

Offline belt9

  • Full Member
  • ***
  • Posts: 233
  • Karma: +24/-6
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #4 on: September 25, 2017, 07:54:00 am »
I'll bet that if you just use dummynet and enable fq_codel via CLI and use that for all your traffic then your problem will be solved.

Fq_codel is like magic for latency sensitive traffic when the pipe is full.


EDIT: This requires 2.4.x to be installed.
« Last Edit: September 26, 2017, 08:57:47 am by belt9 »

Offline PCbuilder1997

  • Jr. Member
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #5 on: September 25, 2017, 11:15:30 am »
I attempted to run the wizard in HFSC with CODEL enabled on all queues and it fixed the problem for me on my end but slowed the WiFi down to the speed of dial-up. Which kind of defeats the purpose of what i want to do.  I am now going to try to run the wizard in CBQ and enable CODEL on all as well.

If it still doesn't work, use FairQ as your shaper, set your interface to 90% of your actual speed, have one queue on your interface, make sure it's the default and enable Codel on it.

Can you help me more with this or explain to me what you mean by having one queue on my interface?

thanks for all your help.

Offline Chrismallia

  • Full Member
  • ***
  • Posts: 259
  • Karma: +20/-4
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #6 on: September 25, 2017, 11:47:50 am »
" but slowed the WiFi down to the speed of dialup"

That is strange it has nothing to do with specifically slowing down the wifi speed, try restarting pfsense after the traffic shaping  setup. if that still does not work for you take Harvy66 advice, he  is one of the best in traffic shaping here you cant get better advice then he can give you

Offline belt9

  • Full Member
  • ***
  • Posts: 233
  • Karma: +24/-6
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #7 on: September 25, 2017, 12:27:07 pm »
fq_codel is not the same as codel. You can only implement it on dummynet and only via CLI. You just turn it on for everything and it will almost certainly solve your problem.

Offline Chrismallia

  • Full Member
  • ***
  • Posts: 259
  • Karma: +20/-4
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #8 on: September 25, 2017, 12:53:34 pm »
fq_codel is not the same as codel. You can only implement it on dummynet and only via CLI. You just turn it on for everything and it will almost certainly solve your problem.

Dude we for sure know what FQ_CODEL is  and that it is not codel, but the OP has to install 2.4 RC first and install it  from the command line, so it is not the supported way to advice yet till it is officially in pfsense

Offline chrcoluk

  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +20/-50
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #9 on: September 25, 2017, 01:54:22 pm »
fq_codel I agree has a good chance of solving this, but if you not comfortable in doing all this in the cli, then try this.

HSFC for downstream and make sure to give the queue handling netflix realtime bandwidth allocation enough for it to stream optimally.

FairQ for upstream.

Enable codel on all queues.

By default the queue size is 50, in certain scenarios this may need to be increased for proper performance, if you increase do it in small chunks. so dont e.g. jump from 50 to 500. A larger queue makes it less likely for packet drops in that queue, and less likely to have packet ordering issues.  However it also increases the possibility of buffer bloat.

There is also RED (random early detection), what this does is drop packets in a queue before the queue fills up, in anticipation of the queue filling up, the aim of this is to slow down throughput in that queue before it gets full.

The issue I think is very likely in the upstream, since streaming is uploading, its likely affecting the ack's from the netflix downstream traffic, so downstream shaping may not have much of an impact.  Fairq+codel combo seems best for me on upstream on altq.  Make sure acks for downstream traffic are properly been allocated to the 'ack' queue on the upstream.
pfSense 2.4
Qotom Q355G4 or Braswell N3150 with Jetway mini pcie 2x intel i350 lan - 4 gig Kingston 1333 C11 DDR3L
 - 60 gig kingston ssdnow ssd - ISP Sky UK

Offline belt9

  • Full Member
  • ***
  • Posts: 233
  • Karma: +24/-6
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #10 on: September 25, 2017, 02:35:39 pm »
fq_codel is not the same as codel. You can only implement it on dummynet and only via CLI. You just turn it on for everything and it will almost certainly solve your problem.

Dude we for sure know what FQ_CODEL is  and that it is not codel, but the OP has to install 2.4 RC first and install it  from the command line, so it is not the supported way to advice yet till it is officially in pfsense

It is officially in pfSense.... You don't install it from the CLI, you just select it.

Offline tman222

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +6/-0
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #11 on: September 25, 2017, 06:06:37 pm »
fq_codel is not the same as codel. You can only implement it on dummynet and only via CLI. You just turn it on for everything and it will almost certainly solve your problem.

Dude we for sure know what FQ_CODEL is  and that it is not codel, but the OP has to install 2.4 RC first and install it  from the command line, so it is not the supported way to advice yet till it is officially in pfsense

It is officially in pfSense.... You don't install it from the CLI, you just select it.

Just to clarify, did you mean fq_codel is officially in pfSense or just Codel - the latter yes I would agree, but if the former, where do you select it?

Offline belt9

  • Full Member
  • ***
  • Posts: 233
  • Karma: +24/-6
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #12 on: September 25, 2017, 06:23:43 pm »
You select it with ipfw

Code: [Select]
ipfw sched 1 config pipe 1 type fq_codel
So if you have dummynet setup with two pipes (up & down) and want to make fq_codel persistent, then in shellcmd ->

Code: [Select]
ipfw sched 1 config pipe 1 type fq_codel && ipfw sched 2 config pipe 2 type fq_codel
If you plug in a monitor on boot you'll see it load up fq_codel, no need to install anything at all, just select it on CLI, and if you want it to persist across reboots, use shellcmd.

Offline tman222

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +6/-0
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #13 on: September 25, 2017, 06:26:30 pm »
You select it with ipfw

Code: [Select]
ipfw sched 1 config pipe 1 type fq_codel
So if you have dummynet setup with two pipes (up & down) and want to make fq_codel persistent, then in shellcmd ->

Code: [Select]
ipfw sched 1 config pipe 1 type fq_codel && ipfw sched 2 config pipe 2 type fq_codel
If you plug in a monitor on boot you'll see it load up fq_codel, no need to install anything at all, just select it on CLI, and if you want it to persist across reboots, use shellcmd.


That makes sense - my apologies, I misunderstood your original post and thought you meant selecting fq_codel in the UI vs the CLI.

Offline belt9

  • Full Member
  • ***
  • Posts: 233
  • Karma: +24/-6
    • View Profile
Re: Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube
« Reply #14 on: September 25, 2017, 06:45:10 pm »
Oh gotya, no worries. Stilla CLI selection, I was just saying it's all preinstalled and ready to go, no additional repositories or sideloading stuff into pfSense.