sindresorhus / fast-cli

Test your download and upload speed using fast.com
MIT License
2.59k stars 110 forks source link

[Solved] Chromium required on headless server #81

Closed tblancher closed 1 year ago

tblancher commented 1 year ago

I understand by default puppeteer requires chromium. After installing the dependencies according to the puppeteer troubleshooting guide, fast would work, but it would merely time out. After running it in debug mode, i.e.

DEBUG=* fast --upload --single-line

I ran into an Inspector.targetCrashed error. After doing some googling, I determined I needed to install the chromium package, in order to pull in ALL of its dependencies (not just the direct ones seen with ldd). Once I did that, fast worked as expected.

It's sad to have to install a GUI program on a headless server. I saw where @sindresorhus had previously based fast-cli on PhantomJS, but it must have had some deficiencies I'm unaware of. A lot of the puppeteer troubleshooting suggests turning off headless mode, but that won't work for a headless server (locally, or in the cloud). I couldn't reproduce this initially on my laptop, but that's because it had chromium installed already.

I was able to fix this on two headless servers. My experience was on Arch Linux, but it should be the same for any other distribution. I wanted fast-cli to work since my ISP's technicians use fast.com for their speed testing (they openly told me not to use my ISP's speedtest server). I've tried speedtest-cli and iperf3 (against a public server) with unsatisfactory results. Once I got fast working on my first try my speed was quite good (870 Mbps ↓ / 390 Mbps ↑)! I intend to run periodic fast speedtests, and log it so I can see my average/maximum/minumum over time.

I post this for anyone else trying to use fast-cli on a headless server, and can't figure out why it doesn't work. I spent a good three hours trying to figure this out, by disabling the timeout, setting the user agent, and trying some other chromium flags.

EDIT: Make sure you run fast on a system with plenty of memory! I was running it on my router (only has 4GiB RAM) and that was limiting how fast fast could be. Running it on a server on my network (with 16GiB RAM) fares MUCH better.

tblancher commented 1 year ago

Closing this issue after nearly five months.