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

Best way to reduce game latency

Scheduled Pinned Locked Moved Traffic Shaping
58 Posts 8 Posters 19.1k 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.
  • A
    areynot
    last edited by Jan 5, 2018, 1:54 PM

    Right now I have a 15/3mb cable connection and would like to keep my latency low while playing world of warcraft and other people watching netflix at the same time.  I set up HFSC with the wizard and the game runs smooth but suffer from occasional lagspikes (not as many as I had before setting TS though).

    My question is…
    -if using HFSC, how do I inform the shaper which rule has a higher priority in the scale so I can put netflix in the back.
    -should I use some other scheduler to achieve this?

    thanks in advance.

    1 Reply Last reply Reply Quote 0
    • H
      Harvy66
      last edited by Jan 5, 2018, 3:16 PM

      HFSC does not have a notion of priority. The question is are the lag spikes a cause of misconfiguration or not being aggressive enough with limiting bandwidth.

      If HFSC is too difficult to figure out the problem yourself, you may be better off with fq_Codel and this lost discussion shows how to set it up with 2.4.x nearer the end https://forum.pfsense.org/index.php?topic=126637.0

      It is turn-key easy, just set your bandwidth. I actually plan on going this route in the near-ish future. But HFSC has been working near perfectly for me for a long while.

      1 Reply Last reply Reply Quote 1
      • K
        KOM
        last edited by Jan 5, 2018, 3:32 PM

        Which of the 15 pages in that thread is 'near the end'??  ;D  Every page is crammed with tech jargon & CLI incantations with every Tom, Dick & Harry chiming in.

        1 Reply Last reply Reply Quote 0
        • A
          areynot
          last edited by Jan 6, 2018, 12:33 AM

          @Harvy66:

          HFSC does not have a notion of priority.

          ok i understand this now.

          @Harvy66:

          The question is are the lag spikes a cause of misconfiguration or not being aggressive enough with limiting bandwidth.

          I wish I knew if it was either one of those, Im not an expert at TS so I didnt really fiddle that much with the queues, theyre all set to whatever values the wizard set them, I only copied the floating rules to adapt to the different games I play.

          Thanks for the suggestion, Ill read that topic you linked.

          1 Reply Last reply Reply Quote 0
          • T
            tman222
            last edited by Jan 6, 2018, 5:54 PM Jan 6, 2018, 5:41 PM

            Yes, it is true that the thread on fq_codel has gotten quite long.  However, most of those posts are us trying to figure out how to make the deployment simple (since it's not in the GUI yet) and how to properly tweak the algorithm's parameters.

            Having said that, here is the basic implementation in a few steps:

            1)  Setup limiters - at minimum you'll need to create two root limiters and then create one queue under reach root limiter.  You can setup more queues if it's required/desired.  This is also where you set your bandwidth limits.
            2)  Apply the queues to the necessary firewall rules (e.g. to the LAN rule(s) that allows your outbound traffic in the "In/Out Pipe" section).
            3)  Enable fq_codel via the command line (can SSH into the firewall for that):  Issue the following command:

            
            ipfw sched 1 config pipe 1 type fq_codel && ipfw sched 2 config pipe 2 type fq_codel
            
            

            To validate that the command has indeed enabled fq_codel, issue this command:

            
            ipfw sched show
            
            

            If all looks good (you should now see fq_codel listed in the output), go ahead and test to see if performance is acceptable.  If not, you can make changes by tweaking the algorithm's default parameters and/or your bandwidth limits.  For instance, you may have to increase the algorithm's target latency if you have a connection with slower upload speed, or decrease your bandwidth limits if e.g. your upload/download speeds aren't stable.

            4)  To make sure that your settings stick between reboots, install the ShellCmd add on package in pfSense.  Once you have done that make sure you add the command in step 3 to ShellCmd.

            Some additional notes:
            1)  On setting up limiters:  See post #121 in the thread:  https://forum.pfsense.org/index.php?topic=126637.msg754199#msg754199
            2)  On tweaking algorithm parameters:  See post #198 (and following) in the thread:  https://forum.pfsense.org/index.php?topic=126637.msg769665#msg769665

            Hope this helps.

            1 Reply Last reply Reply Quote 0
            • A
              areynot
              last edited by Jan 15, 2018, 12:46 AM

              Thank you so much mr tman22, this has solved 50% of my problems… now my question is... how do I set up ts so I can prioritize games over netflix?

              1 Reply Last reply Reply Quote 0
              • H
                Harvy66
                last edited by Jan 15, 2018, 4:39 AM

                Are you seeing an issue that you need to use priorities?

                1 Reply Last reply Reply Quote 0
                • A
                  areynot
                  last edited by Jan 15, 2018, 11:02 AM

                  @Harvy66:

                  Are you seeing an issue that you need to use priorities?

                  even though i can tell bufferbloat is almost gone through dslreports tests, I can still see increased latency when someone is downloading a big file or watching netflix

                  1 Reply Last reply Reply Quote 0
                  • H
                    Harvy66
                    last edited by Jan 15, 2018, 2:27 PM

                    Have you tried further reducing your provisioned bandwidth just to see if it helps? In theory, fq_Codel properly configured should pretty much keep your latency of other flows to within a few milliseconds, except if two flows get assigned to the same bucket.

                    1 Reply Last reply Reply Quote 0
                    • A
                      areynot
                      last edited by Jan 15, 2018, 9:46 PM

                      @Harvy66:

                      …except if two flows get assigned to the same bucket.

                      howcan I monitor buckets???

                      1 Reply Last reply Reply Quote 0
                      • T
                        tman222
                        last edited by Jan 16, 2018, 11:43 PM

                        @areynot:

                        @Harvy66:

                        Are you seeing an issue that you need to use priorities?

                        even though i can tell bufferbloat is almost gone through dslreports tests, I can still see increased latency when someone is downloading a big file or watching netflix

                        There are a few more things you can try before considering moving on to a different scheduling algorithm:

                        1)  As Harvy66 already mentioned, you can try to reduce your bandwidth limits further (especially if your upload/download speeds aren't very stable).
                        2)  To favor interactive flows, try reducing the quantum parameter from the default.  Start reading here for more details on how to go about this:  https://forum.pfsense.org/index.php?topic=126637.msg769665#msg769665
                        3)  One last thing you could to is create multiple queues under your limiter and assign each of them weights.  For instance, let's assume you had two queues under each limiter with weight 50.  This would ensure that each queue is guaranteed at least 50% of the bandwidth, and more (up to full) if the other queue does not have any traffic in it.  Once you have those queues created, you'd have to create the relevant firewall rules to match your game traffic, assign one set of queues to it, and then assign the other set of queues to your rule that handles the remaining traffic (e.g. web traffic, netflix, etc.).  This is a little bit more tricky to setup, so I would recommend trying 1) and 2) first.

                        Hope this helps.

                        1 Reply Last reply Reply Quote 0
                        • A
                          areynot
                          last edited by Jan 17, 2018, 10:49 AM

                          thank you so much for helping me… I will be trying all of these options and will let you know how it went =)

                          1 Reply Last reply Reply Quote 0
                          • A
                            areynot
                            last edited by Jan 27, 2018, 11:14 AM

                            @tman222:

                            @areynot:

                            @Harvy66:

                            Are you seeing an issue that you need to use priorities?

                            even though i can tell bufferbloat is almost gone through dslreports tests, I can still see increased latency when someone is downloading a big file or watching netflix

                            3)  One last thing you could to is create multiple queues under your limiter and assign each of them weights.  For instance, let's assume you had two queues under each limiter with weight 50.  This would ensure that each queue is guaranteed at least 50% of the bandwidth, and more (up to full) if the other queue does not have any traffic in it.  Once you have those queues created, you'd have to create the relevant firewall rules to match your game traffic, assign one set of queues to it, and then assign the other set of queues to your rule that handles the remaining traffic (e.g. web traffic, netflix, etc.).  This is a little bit more tricky to setup, so I would recommend trying 1) and 2) first.

                            Can you please give me a hand with this?

                            Do i create a floating rule for games and assign one of the two 50/50 pipes to it and let the other one in the default LAN rule?

                            thanks so much mr tman

                            1 Reply Last reply Reply Quote 0
                            • N
                              necroxix
                              last edited by Jan 29, 2018, 5:47 AM

                              I have similar needs, except I'm trying to make a second set of queues for my twitch stream traffic so that I don't drop RTMP packets but the weight settings don't seem to do anything different. If I stream and do a speedtest, a consistent number of stream packets get dropped. Chances are, I got something misconfigured but it's at least easy for me to reproduce the test to know if I get it working, so if I figure it out I'll chime in because if I did the same with my game traffic, it wouldn't work any differently.

                              1 Reply Last reply Reply Quote 0
                              • Z
                                zwck
                                last edited by Mar 21, 2018, 3:28 PM

                                I have some "issues" with the download queue. So i'd like to tell you what i have done so far.

                                I am on PfSense 2.4.2_1 and i have a symetrical 1000Mbit line and DSL reports
                                image before is attached. And My dsl report looks like this, as expected (image_1…)

                                1. Creating Limiters (screenshots attached for the upload Part, for the download part its the same but with a different name)
                                • Upload (limited to 900Mbit)

                                • highUp 75

                                • defaultUp 25

                                • lowUp 5

                                • Download (limited to 900Mbit)

                                • HighDown

                                • defaultDown

                                • lowDown

                                1. Creating Floating rules Rules
                                  I created in total 6 Floating rules but only going to show the default ones in the screenshots
                                  the other ones are basically clones anyway

                                2. Installing the shellcmd package and adding
                                  ipfw sched 1 config pipe 1 type fq_codel && ipfw sched 2 config pipe 2 type fq_codel

                                3. horrible results, something is not working right on the download side, dunno what it is :D

                                I added an imgur album to just take a look at all the screenshots. https://imgur.com/a/bkIuA maybe @tman has an idea what i am doing :(

                                1 Reply Last reply Reply Quote 0
                                • T
                                  tman222
                                  last edited by Mar 21, 2018, 4:36 PM

                                  @zwck:

                                  I have some "issues" with the download queue. So i'd like to tell you what i have done so far.

                                  I am on PfSense 2.4.2_1 and i have a symetrical 1000Mbit line and DSL reports
                                  image before is attached. And My dsl report looks like this, as expected (image_1…)

                                  1. Creating Limiters (screenshots attached for the upload Part, for the download part its the same but with a different name)
                                  • Upload (limited to 900Mbit)

                                  • highUp 75

                                  • defaultUp 25

                                  • lowUp 5

                                  • Download (limited to 900Mbit)

                                  • HighDown

                                  • defaultDown

                                  • lowDown

                                  1. Creating Floating rules Rules
                                    I created in total 6 Floating rules but only going to show the default ones in the screenshots
                                    the other ones are basically clones anyway

                                  2. Installing the shellcmd package and adding
                                    ipfw sched 1 config pipe 1 type fq_codel && ipfw sched 2 config pipe 2 type fq_codel

                                  3. horrible results, something is not working right on the download side, dunno what it is :D

                                  I added an imgur album to just take a look at all the screenshots. https://imgur.com/a/bkIuA maybe @tman has an idea what i am doing :(

                                  I have not set this up with matching floating rules before, but one thing I noticed right away looking at your screenshots is that you are missing the source and destination masks in your upload and download queues.

                                  For each of your download queues, choose "Destination addresses" for the Mask.  For each of your upload queues, choose "Source addresses" for the Mask.

                                  Hope this helps.

                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    Harvy66
                                    last edited by Mar 21, 2018, 6:50 PM

                                    fq_codel is great at reducing latency on its own. Adding complexity by having more queues may actually make it worse. Of course not in relation to the issue you're seeing.

                                    1 Reply Last reply Reply Quote 0
                                    • Z
                                      zwck
                                      last edited by Mar 21, 2018, 7:12 PM Mar 21, 2018, 6:58 PM

                                      @tman222:

                                      stuff

                                      not sure what you mean here, would you mind sending me some screenshots or uploading them here, i thought the floating rules were necessary. I just added for my upload limiters source  and for my download limiters destination with the same results :(

                                      1 Reply Last reply Reply Quote 0
                                      • Z
                                        zwck
                                        last edited by Mar 21, 2018, 7:13 PM

                                        @Harvy66:

                                        fq_codel is great at reducing latency on its own. Adding complexity by having more queues may actually make it worse. Of course not in relation to the issue you're seeing.

                                        What would be the easiest setup here? i dont mind not dealing with queues :D

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          tman222
                                          last edited by Mar 21, 2018, 8:52 PM

                                          @zwck:

                                          @tman222:

                                          stuff

                                          not sure what you mean here, would you mind sending me some screenshots or uploading them here, i thought the floating rules were necessary. I just added for my upload limiters source  and for my download limiters destination with the same results :(

                                          Actually the most basic setup requires only an upload and download limiter with one queue under each, and no matching firewall rules.

                                          Here's how you would set that up:

                                          First, remove your existing settings including your matching firewall rules you created for fq_codel.

                                          Next:
                                          1)  Create a upload and download limiter and set their bandwidth limits
                                          2)  Create one queue under the Upload limiter, i.e. in your case let's call this "in" and make sure the Mask field is set to "Source Addresses".  Leave the Weight field empty.
                                          3)  Create one queue under the Download limiter, i.e. in your case let's call this "out" and make sure the Mask field is set to "Destination Addresses".  Leave the Weight field empty.
                                          4)  Next go to your LAN interface and find the rule that allows outbound traffic to the internet (e.g. your default allow all rule).  Under that rules' settings, go to Advanced Options, In/Out Pipe.
                                          5)  For the In Pipe use the queue you created under the upload limiter, in your case the "in" queue.
                                          6)  For the Out Pipe use the queue you created under the download limiter, in your case the "out" queue.
                                          7)  Enable fq_codel with this command:  ipfw sched 1 config pipe 1 type fq_codel && ipfw sched 2 config pipe 2 type fq_codel
                                          8 )  Speed test and check for buffer bloat.

                                          Harvy66 is right that fq_codel is pretty good at reducing latency without having to filter traffic into different queues first and then applying fq_codel.  In my case I'm only using multiple weighted queues to control the total amount of bandwidth available to different VLAN's instead of controlling the amount of bandwidth available to different traffic on the same interface/VLAN.  That may still be possible to do (e.g. with matching firewall rules), but unfortunately I have don't have any specific experience with such a setup.

                                          Hope this helps.

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received