arevindh / pihole-speedtest

Pihole Speedtest Mod
https://arevindh.github.io/pihole-speedtest/
MIT License
218 stars 22 forks source link

Scheduled Speedtest download now consistently halved in newest pihole-speedtest release #137

Closed ChrisWNY closed 1 year ago

ChrisWNY commented 1 year ago

This is an odd issue but is definitely reproduceable and consistent in the latest pihole-speedtest release...

Whenever the scheduled speedtest script kicks off (I have it set to use a specific speedtest server ID) , which I have set to run every 12 hours, I get HALF the download speed I would expect, but full upstream speed. This is consistent. My WAN is 1Gb symmetrical, so normally my tests are 900-950Mbps up and down, with some variation based on circumstances between my WAN and the speedtest server. This problem is consistent with DOWNLOAD speed halved on every scheduled speedtest run.

When I go into the pihole-speedtest settings and check off the RUN TEST NOW checkbox, then submit, I get full download/upload speedtest results, as expected. This is reproduceable every time. Note that RUN TEST NOW and the scheduled speedtest script use the exact same speedtest server, same ID.

Has anyone else encountered this behavior? I've never observed anything like this up until the latest release. Not sure what's going on with the scheduled script, it was very reliable up until this most recent update.

arevindh commented 1 year ago

@ChrisWNY I think it might be due to fewer resources allocated when running in systemd service mode.

Can you try running this directly

sudo /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.sh

arevindh commented 1 year ago

@ChrisWNY also try switching to cron

sudo crontab -e -u root

then add

0 */12 * * * sudo "/var/www/html/admin/scripts/pi-hole/speedtest/speedtest.sh""
ipitio commented 1 year ago

I did include CPUQuota=20% in the systemd unit, could that be the cause?

arevindh commented 1 year ago

CPUQuota

Might have, @ipitio can you give instructions to remove those and test .

ipitio commented 1 year ago

To remove that and test, run sudo systemctl edit --full pihole-speedtest.service. This will open the unit file; remove the line with the quota, save and exit, and run sudo systemctl daemon-reload.

ChrisWNY commented 1 year ago

Thanks guys - I am in the process of making the edits. The scheduled script will kick off in 20 mins...so I'll post another update shortly.

Btw, running sudo /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.sh gave me full down/up, 930Mbps on both.

I've also completed the edits, removed the CPUQuota=20% statement. I suppose upstream uses a lot less CPU than downstream?

ChrisWNY commented 1 year ago

Well that solved the problem. Scheduled script kicked off, 930Mbps downstream/upstream. Thanks for the prompt responses!

ipitio commented 1 year ago

Awesome, I'll remove the quota. I thought 20% would be enough for a speedtest haha.

ChrisWNY commented 1 year ago

Apparently 1Gbps NIC transfer pushes that Pi 4b CPU to the edge lol...I wouldn't worry too much about quotas on the CPU since the speedtests are short-lived, but understand it's probably best practice to set quotas.

ChrisWNY commented 1 year ago

The change to the CPU quota fixed this issue. Closing.