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

    Speedtest CLI. Run speedtest on pfSense box

    Scheduled Pinned Locked Moved pfSense Packages
    167 Posts 52 Posters 151.4k 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
      aln @johnpoz
      last edited by

      @johnpoz I don't know how your logic works, but if I want to test my ISP then I want to exclude switches and wifi APs from the test.
      Your explanation on how a router (yes, pfSense is basically a router, no need to use parentheses) is not a client is completely wrong. A router is first of all a client, it connects to a network and being served an IP address. Therefor it's a client!
      Your test on the router shows slower results because your CPU doesn't have the juice to run the test, that's all. For many others it works perfectly. And why do we use those over sized hardware? Because we can afford it, we don't care about the electricity bill, we like playing with it and ... we can run speedtest on it :)

      1 Reply Last reply Reply Quote 0
      • N
        netblues
        last edited by

        Also, in some cases, especially in remote support, it is not practical to have access to internal resources to run browser based speed test or cli over unix terminals.
        So, yes, if we are optimizing things, probably it won't cut it.
        But if we need a broad estimate if things are more or less within expected performance, this comes handy.
        A problematic wan connection will be revealed immediately if there is packet loss, errors etc., before even touching any access cpe.

        Certainly, there is no one size fits all answer to this :)

        1 Reply Last reply Reply Quote 0
        • A
          adamoutler @aln
          last edited by

          @aln please start a new thread. This needs a new thread.

          R 1 Reply Last reply Reply Quote 1
          • R
            RaidArray
            last edited by

            I guess I have some apologies to make,

            first, sorry for providing the original instructions for the how to make the gui to show the speedtest, I feel it may have divided the community over whether it should exist, allowing for the user to test speed from the router itself or a device behind it. my need came about because every time I had an issue with my ISP I was forced to unplug everything from their device and plug in a single laptop/desktop which after a period of time became a pain point.

            secondly my website is back online at a new address www.some-useful.info, sorry it's took a while, but having seen the progress made by the likes of aln and his script, it's not really relevant anymore as we've moved on from the original I came up with.

            As a request to aln can you look to include a check for updates button on your implementation or have the script check for updates periodically, save me looking for posts that say an update has been issued.

            regards
            Zak

            A 1 Reply Last reply Reply Quote 0
            • R
              RaidArray @adamoutler
              last edited by

              @adamoutler, sorry i've missed loads on this thread and the general bigger picture, but how does starting a new thread help?

              A 1 Reply Last reply Reply Quote 0
              • A
                aln @RaidArray
                last edited by

                Hi @RaidArray ,

                To be honest about it I didn't even see your earlier post before jumping into this thread.
                I did read it now. There is one problem with your approach, embedding a widget the way you did still doesn't perform the test from the router but rather from the client. All the test is done from the browser and by this you miss your original goal, that is to test your ISP.
                If you have the traffic graphs widget on the dashboard and you monitor WAN and LAN networks you can see that running my widget will show traffic only on the WAN interface. With your approach you will see the traffic on the LAN as well.
                My reason for creating a widget is exactly as you describe it, testing my connection directly on the line so my ISP cant BS me and ask me do disconnect half of my equipment.
                This is really quick and dirty work, but your idea of including update (or even autoupdate) is great! TY.

                R 2 Replies Last reply Reply Quote 1
                • R
                  RaidArray @aln
                  last edited by RaidArray

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • M
                    MoonKnight @johnpoz
                    last edited by MoonKnight

                    @johnpoz said in Speedtest CLI. Run speedtest on pfSense box:

                    JFC I5-7600 cpu for a "router" That is nuts for any sort of soho network... That cpu has a tdp of 65W.. Why would anyone want such beast to firewall/route.. Just sucking juice!

                    I have no idea who you're talking about 🤣 🤐

                    --- 24.11 ---
                    Intel(R) Xeon(R) CPU D-1518 @ 2.20GHz
                    Kingston DDR4 2666MHz 16GB ECC
                    2 x HyperX Fury SSD 120GB (ZFS-mirror)
                    2 x Intel i210 (ports)
                    4 x Intel i350 (ports)

                    1 Reply Last reply Reply Quote 0
                    • A
                      adamoutler @RaidArray
                      last edited by

                      @RaidArray because this is for CLI. @aln is a GUI. It needs its own thread for updates, support, contribution, and feature requests. Each separate item should have its own thread. Also, it helps with advertising.

                      1 Reply Last reply Reply Quote 0
                      • chpalmerC
                        chpalmer @jimp
                        last edited by

                        @jimp said in Speedtest CLI. Run speedtest on pfSense box:

                        That looks nice, though it's usually better to test bandwidth through the firewall and not from the firewall itself. pfSense has been optimized to work in a routing role, so sometimes you might see reduced numbers when pfSense itself is acting like the client.

                        Point-
                        On my "made to be a router" Watchguard XTM5 box with a 4 core 3ghz proc running pfsense I only see about 50% of my speed on the router itself. But full speed + on the LAN.

                        I still like this idea and plan on using it on some remote sites where I have no computer on site to access and test.

                        Triggering snowflakes one by one..
                        Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

                        1 Reply Last reply Reply Quote 0
                        • A
                          aln
                          last edited by

                          Hi All,

                          Hearing the comments here I did a complete rebuild.
                          The new version on github is using Netflix'es fast.com and not Ookla's speedtest.net, it is single threaded and should be easier on lesser cpus.
                          It also does not depend on the speedtest-cli package.
                          Feedbacks are welcomed.

                          download

                          A N 2 Replies Last reply Reply Quote 0
                          • johnpozJ
                            johnpoz LAYER 8 Global Moderator
                            last edited by johnpoz

                            Yeah that is even more of difference..

                            worse.jpg

                            Let me say this once again!!! Speed test on "routers" is not valid... You with your I5 freaking ROCKETship desktop/server box is not a "router".. Even if your using it as one ;)

                            So while such test have use, its going to cause users to question.. Why is pfsense slow... Has been doing so for years.. Ever since the first time the php client was shown that it would run on pfsense.

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 24.11 | Lab VMs 2.8, 24.11

                            A 1 Reply Last reply Reply Quote 0
                            • T
                              tman222
                              last edited by

                              @aln and everyone -

                              Has anybody tried using the official Ookla Speedtest.net FreeBSD CLI package on pfSense instead of the third party speedtest-cli package?

                              https://www.speedtest.net/apps/cli

                              I'm curious if this could just be a drop in replacement or has the potential to cause issues. Thanks in advance!

                              A R 2 Replies Last reply Reply Quote 0
                              • A
                                adamoutler @aln
                                last edited by

                                @aln you really need to start a new thread

                                1 Reply Last reply Reply Quote 0
                                • N
                                  netblues @aln
                                  last edited by

                                  @aln After a few runs, new speedtest seems not to report new values. I see it generates traffic, seems to complete but no new output is reported. Tried removing it and re adding and it comes with same results, even without running.. Any ideas?

                                  A 1 Reply Last reply Reply Quote 0
                                  • A
                                    aln @tman222
                                    last edited by

                                    @tman222 i tried it on osx, seems to lock my computer. also if you are on freebsd on non x86 architecture then you're out of luck.

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      aln @netblues
                                      last edited by

                                      @netblues difficult to say. Do you get any errors on your browser's dev tools? can you maybe paste the request and response that the widget generates?

                                      N 1 Reply Last reply Reply Quote 0
                                      • A
                                        aln @johnpoz
                                        last edited by

                                        @johnpoz got it, it doesn't work for you. Did you notice that a widget has an uninstall (-) button?

                                        johnpozJ 1 Reply Last reply Reply Quote 0
                                        • N
                                          netblues @aln
                                          last edited by netblues

                                          @aln After some fiddling, I thing the problem is on how you interpret upload speed
                                          It is completely wrong. It reports 26.6 when both trafic graphs AND running fast from browser reports upload around 4.
                                          For test, I just inserted an

                                          $upload = number_format($info['upload_content_length'] * 8 / $info['total_time'] / 1024 / 1024, 2);
                                          $upload = 5;

                                          effectively ovewriting the result, and got it reported after a speed test
                                          Download speed and everything else seems to work

                                          0c5e76d8-87c0-406d-9954-8055c475cecf-image.png

                                          (and the time is completely wrong too, but thats minor)

                                          A 1 Reply Last reply Reply Quote 0
                                          • A
                                            aln @netblues
                                            last edited by

                                            @netblues thanks for the feedback!
                                            I don't think that the calculation is wrong cause thats also how download is being calculated. I suspect that I push a too large upload that might be rejected by the server.
                                            Can you check if the latest version works for you?

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