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

Speedtest CLI. Run speedtest on pfSense box

pfSense Packages
52
167
136.5k
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
    last edited by May 19, 2020, 10:54 PM

    I've created a widget to run speedtest directly from your pfSense dashboard
    https://github.com/aln-1/pfsense-speedtest-widget

    P A A A 4 Replies Last reply May 20, 2020, 9:56 AM Reply Quote 4
    • P
      provels @aln
      last edited by May 20, 2020, 9:56 AM

      @aln Hey, it works! Nice job! :)

      login-to-view

      Peder

      MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
      BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

      A 1 Reply Last reply May 20, 2020, 3:43 PM Reply Quote 0
      • J
        johnpoz LAYER 8 Global Moderator
        last edited by May 20, 2020, 10:44 AM

        Pretty slick.. Nice work..

        Not really a fan of running speedtest on pfsense itself, its always better to do them "thru" pfsense (from a client behind).. But yeah could see how it could come in handy for some.

        login-to-view

        Allowing for some settings, like picking server, etc.. would be even extra slick ;)

        2.4.5-RELEASE][admin@sg4860.local.lan]/: speedtest -h
        usage: speedtest [-h] [--no-download] [--no-upload] [--single] [--bytes]
                         [--share] [--simple] [--csv] [--csv-delimiter CSV_DELIMITER]
                         [--csv-header] [--json] [--list] [--server SERVER]
                         [--exclude EXCLUDE] [--mini MINI] [--source SOURCE]
                         [--timeout TIMEOUT] [--secure] [--no-pre-allocate]
                         [--version]
        
        Command line interface for testing internet bandwidth using speedtest.net.
        --------------------------------------------------------------------------
        https://github.com/sivel/speedtest-cli
        
        optional arguments:
          -h, --help            show this help message and exit
          --no-download         Do not perform download test
          --no-upload           Do not perform upload test
          --single              Only use a single connection instead of multiple. This
                                simulates a typical file transfer.
          --bytes               Display values in bytes instead of bits. Does not
                                affect the image generated by --share, nor output from
                                --json or --csv
          --share               Generate and provide a URL to the speedtest.net share
                                results image, not displayed with --csv
          --simple              Suppress verbose output, only show basic information
          --csv                 Suppress verbose output, only show basic information
                                in CSV format. Speeds listed in bit/s and not affected
                                by --bytes
          --csv-delimiter CSV_DELIMITER
                                Single character delimiter to use in CSV output.
                                Default ","
          --csv-header          Print CSV headers
          --json                Suppress verbose output, only show basic information
                                in JSON format. Speeds listed in bit/s and not
                                affected by --bytes
          --list                Display a list of speedtest.net servers sorted by
                                distance
          --server SERVER       Specify a server ID to test against. Can be supplied
                                multiple times
          --exclude EXCLUDE     Exclude a server from selection. Can be supplied
                                multiple times
          --mini MINI           URL of the Speedtest Mini server
          --source SOURCE       Source IP address to bind to
          --timeout TIMEOUT     HTTP timeout in seconds. Default 10
          --secure              Use HTTPS instead of HTTP when communicating with
                                speedtest.net operated servers
          --no-pre-allocate     Do not pre allocate upload data. Pre allocation is
                                enabled by default to improve upload performance. To
                                support systems with insufficient memory, use this
                                option to avoid a MemoryError
          --version             Show the version number and exit
        [2.4.5-RELEASE][admin@sg4860.local.lan]/: 
        

        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.7.2, 24.11

        1 Reply Last reply Reply Quote 0
        • A
          aln @provels
          last edited by May 20, 2020, 3:43 PM

          @provels I'm glad I could contribute something back to the community.
          @johnpoz the only reason to run speedtest on pfSense is to test your ISP without speed drops of other elements in your network.

          A A J E 4 Replies Last reply May 20, 2020, 4:00 PM Reply Quote 1
          • A
            adamoutler @aln
            last edited by May 20, 2020, 4:00 PM

            Thank you very much, @aln!

            I don't know why this isn't a stock package. Speed test on a router is a must. Thank you ever so much. This is by far my most needed package and you have just made my dreams come true.

            To show my appreciation, I'd like to contribute some easy-install instructions. This short script does what you said to do. It won't install the widget if the pkg install fails. This can be run from the Diagnostics> Command Prompt > Execute Shell Command

            pkg update ; pkg install -y py37-speedtest-cli && curl -o /usr/local/www/widgets/widgets/speedtest.widget.php https://raw.githubusercontent.com/aln-1/pfsense-speedtest-widget/master/speedtest.widget.php
            

            Please consider further development, making this an official pFSense package. I'm very happy this is now a thing and thank you ever so much.

            After hitting the refresh button, it comes up blank and never shows my results. I have to refresh the page to see the results. Any ideas?
            login-to-view
            login-to-view

            A 1 Reply Last reply May 20, 2020, 5:04 PM Reply Quote 3
            • A
              aln @adamoutler
              last edited by May 20, 2020, 5:04 PM

              @adamoutler when hitting the refresh button did it finish spinning? Can you see if there are any warning or errors in the browser's developer tools?
              The widget will show an empty image initially and will cache the last speedtest results. You will be able to see them for as long as Ookla is caching them, as far as I can say this is forever.

              A 1 Reply Last reply May 20, 2020, 9:56 PM Reply Quote 0
              • P
                provels
                last edited by provels May 20, 2020, 5:11 PM May 20, 2020, 5:09 PM

                FWIW, when I ran it the second time, I also got an empty box, but every subsequent run it went fine. I just hit the chasing arrows again.

                Peder

                MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
                BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

                1 Reply Last reply Reply Quote 0
                • A
                  aln @aln
                  last edited by May 20, 2020, 5:22 PM

                  I get some positive feedbacks and that's nice.
                  This was really quick and dirty widget. Maybe I'll take it a step further.
                  I'll keep you posted.

                  1 Reply Last reply Reply Quote 1
                  • A
                    adamoutler @aln
                    last edited by May 20, 2020, 9:56 PM

                    @aln maybe a reboot is required to reload the PHP system? It just stopped spinning and went blank.

                    A 1 Reply Last reply May 20, 2020, 11:25 PM Reply Quote 0
                    • A
                      aln @aln
                      last edited by May 20, 2020, 11:24 PM

                      @aln new and improved version is now available
                      login-to-view

                      A J 2 Replies Last reply May 21, 2020, 12:51 AM Reply Quote 3
                      • A
                        aln @adamoutler
                        last edited by May 20, 2020, 11:25 PM

                        @adamoutler reboot should not be needed

                        1 Reply Last reply Reply Quote 0
                        • A
                          adamoutler @aln
                          last edited by May 21, 2020, 12:51 AM

                          @aln not sure how to activate it.
                          !login-to-view

                          A 1 Reply Last reply May 21, 2020, 7:23 AM Reply Quote 0
                          • J
                            J24 @aln
                            last edited by May 21, 2020, 2:14 AM

                            @aln Maginficent!!! Thank you!

                            login-to-view image url)

                            1 Reply Last reply Reply Quote 1
                            • A
                              aln @adamoutler
                              last edited by May 21, 2020, 7:23 AM

                              @adamoutler I committed a fix. try the latest version.

                              1 Reply Last reply Reply Quote 0
                              • J
                                johnpoz LAYER 8 Global Moderator @aln
                                last edited by johnpoz May 21, 2020, 12:09 PM May 21, 2020, 12:00 PM

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

                                only reason to run speedtest on pfSense is to test your ISP without speed drops of other elements in your network.

                                And what might those be? While I hear you, the problem is running speedtest on your router doesn't always show you full speed of your connection.. Router meant to route, not but be a client... There are many thread here with people asking why when run speed test on pfsense do I not see my full isp speed..

                                Such any tool that makes it easy to do the test, it for sure going to bring more and more of those questions.
                                See @jimp post from above https://forum.netgate.com/post/675198

                                example just ran, to same server
                                login-to-view

                                Not saying not good work.. Problem is there is rarely a time you need to run such a test from the edge.. If you think something in your network is slowing down your connection, then connect direct to the router with your client.

                                2nd test.. same thing connection from router is showing slower than thru router
                                login-to-view

                                This is to be expected.. Nothing wrong with the router.. Its just not really a place to test if your getting full speed from your isp. Since the router is not meant to be a client in such tests, its meant to route packets..

                                Same thing comes up all the time over on the unifi forums about their routers doing speed tests.

                                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.7.2, 24.11

                                M 1 Reply Last reply May 21, 2020, 12:24 PM Reply Quote 1
                                • M
                                  MoonKnight @johnpoz
                                  last edited by May 21, 2020, 12:24 PM

                                  @johnpoz
                                  Hi, I don't see so much different in the speedtest from pfsense or form my computer. Only different is the ping, but not much 2-5 ms different. :)

                                  --- 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
                                  • J
                                    johnpoz LAYER 8 Global Moderator
                                    last edited by johnpoz May 21, 2020, 12:36 PM May 21, 2020, 12:35 PM

                                    And what is your internet speed?

                                    Intel(R) Core(TM) i5-7400 CPU

                                    That is a pretty hefty "router" cpu ;)

                                    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.7.2, 24.11

                                    M 1 Reply Last reply May 21, 2020, 12:45 PM Reply Quote 0
                                    • M
                                      MoonKnight @johnpoz
                                      last edited by May 21, 2020, 12:45 PM

                                      @johnpoz
                                      I have 500/500 Mbps

                                      login-to-view

                                      login-to-view

                                      Yeah, i do have an overkill pfsense. But right now i'm running my backup pfsense, so only Intel (R) Core(TM) i5-6400 CPU, hehe :)

                                      --- 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)

                                      L A 2 Replies Last reply May 21, 2020, 1:38 PM Reply Quote 0
                                      • L
                                        luckman212 LAYER 8 @MoonKnight
                                        last edited by May 21, 2020, 1:38 PM

                                        @johnpoz makes a good point, many pfSense installs on low power CPUs such as ARM or Atom will fail to measure the speed accurately. I've experienced this many times.

                                        BUT, it's still very useful to have this as a "grain of salt" measurement, esp. when access to the LAN is limited or degraded. This has helped me confirm for example, that a remote site's ISP connection (300Mbps) was running fine, and that the slowness they were experiencing was due to a poor WiFi connection. Up to around 300Mbps the speeds can usually be measured reasonably well - even on devices like the SG2440 or SG3100.

                                        1 Reply Last reply Reply Quote 2
                                        • A
                                          aln @MoonKnight
                                          last edited by May 21, 2020, 2:08 PM

                                          @CiscoX I guess my pfSense also falls in the overkill category i5, 8GB, 60GB :)

                                          1 Reply Last reply Reply Quote 2
                                          52 out of 167
                                          • First post
                                            52/167
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.