[Solved] Is it possible to install librespeed Speed Test on OpenWrt?

Is it possible to run https://github.com/librespeed/speedtest in Openwrt?

What webserver does Openwrt run?

https://openwrt.org/docs/guide-user/services/webserver/http.uhttpd

I installed php and uploaded the script to 192.168.1.1/speedtest/
The problem is upload works fine but the download speed is 0.16mbps and upload speed is 1000mbps.

Is the router not powerful enough for download processing?

Update: Fixed it by editing garbage.php
Replaced
$data=openssl_random_pseudo_bytes(1048576);
with
$data=random_bytes(1048576);
Now everything works fine.

2 Likes

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

This is pretty cool. I have a few questions for you @openwrtforever...

  • What hardware are you using?
  • Aside from installing php and adjusting the random data, did you need to make any other special configuration changes to get this to run at line rate?
  • were you running this as a speediest server (i.e. visiting this url from your computer, measuring the bandwidth between your computer and your router the way you would any external speediest server)?
  • Or was this running as a client to some other speediest server (i.e. a remote server on the internet or a server on your local network)?

Many routers don't have the horsepower to generate/terminate packets at line rate, even if they can route them effortlessly... so I'm curious what your experience has been (clearly it was running quite well on your system).

2 Likes

Hi,

  • I am using WRT3200ACM.
  • Not really, I lowered the PHP execution time a little, I also had to change the javascript to disable remote IP address information, I wanted to keep it private.
  • Yes, I wanted to run a local speed test server to see the speed of different wireless and lan devices.

Here is the complete package if you want on your device.

3 Likes

Thanks. I'll play around with it.

It seems to work without php7 installed on my router and with the uhttpd web server. I was able to copy the files and they just worked. I am getting bit of junk at the bottom of the screen and really low speeds (but the devices are old -- that may just be the nature of the beast for these). Any thoughts about what I might be doing wrong or differently? The performance was the same when I did install php7, too.

Did you install openssl?

1 Like

I got the same thing, it means PHP is not running. Edit the file /etc/config/uhttpd and uncomment
# list interpreter ".php=/usr/bin/php-cgi"
to
list interpreter ".php=/usr/bin/php-cgi"
Then restart the server
/etc/init.d/uhttpd restart

You dont need to install openssl. Let me know if it works.

1 Like

Thanks.

So, that fixed the php issue, but then I got another error about not having php-cgi. So I installed that. Now it works exactly as it should, but is really bad in terms of performance. It greatly improved the download speed, but the upload speed tanked (not to mention ping skyrocketing). This is an ancient router (Linksys E3000) that I use for experimentation, so it may be simply limited by the SoC (it is not limited by the physical connection -- gigabit ethernet directly connected).

So my current status on 19.07.3 (Linksys E3000) is that I copied the files over and installed php
opkg install php7 php7-cgi (I actually had to delete a bunch of files (license, readme, docs, etc.) from the speedtest folder to fit it on this old router... I might throw extroot at this if I continue to play with it or if I need to install anything else.

FWIW, if I deploy this anywhere, it will be on a Ubiquiti RouterStation Pro (which is also ancient, but may perform better) -- it is my VPN server, not my main router.

Any other ideas/thoughts?

1 Like

Works fine, but download speed performance is too low.

Intel Celeron N3160

8G RAM

1 Like

I removed all the unnecessary files, it should be couple of files now.

2 Likes

Updated, but same result.

1 Like

Can't that piece of PHP be converted to lua?
Seems that it doesn't really justify installing php on embedded hardware...

1 Like

I tried working with lua but the speed was extremely slow, 0.17/0.16. I dont think lua is made for a web server, I think only PHP can do this kind of job unless someone professional with lua comes up with something.
This is what I had for garbage.lua

local Code = {}
for i = 1, 100 do
    table.insert(Code, string.char(math.random(65, 90)))
    print(Code[i])
end
1 Like

Just a quick note that by default libreseepd test is documented to return 1.06 times the actually measured goodput, see overheadCompensationFactor for how to change that. IMHO it is safer to simply return the measured goodput by setting overheadCompensationFactor to 1.0 instead of trying to make guesses about the actually relevant overhead, as that can and will be wildly different depending on link technology and on the level one is actually interested in.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.