I’m trying to install a Pihole 5.18.4 on a new install (VM). I’ve been running Pihole for years on a Raspberry Pi 3B+ and while it works great the one issue I have with it is incredibly slow retrieval of log data. If I want to go back and search through the logs or even bring up a single device’s activity it takes a very long time. The Pi is running off a USB SSD drive so storage isn’t the issue.
I’d love to go with the latest version but I know multiple people that are impacted by this bug (High CPU usage and bad browisng experience after upgrade to v6 from v5 · Issue #6061 · pi-hole/pi-hole · GitHub) that seemingly has no one addressing it despite it being opened since March. I recognize there are workarounds but I’d prefer not to have to either manually delete my database or limit the database to 5-7 days in order to avoid the bug.
Funnily I finally upgraded from v5 to v6 yesterday (having quite some troubles by the way spending more than 5 hours because of config settings resulting in an unwanted behavior and mainly because of the API change which makes is so damn hard to nearly impossible continue using stuff like custom sensors in Home Assistant - damn session ID and max session rate limit I hate you ).
But I made/have a full v5 backup so the basic-install.sh script for v5 here (should be the same like in the topic mentioned in the OP):
The cleanest way to install Pi-hole 5 is via Pi-hole's official Docker image. The Pi-hole installation script doesn't support installing arbitrary releases.
It's not clear whether all participants in that GitHub issue report would have been suffering from the same conditions.
That's not to deny the issue exists, but that GitHub discussion has indications e.g. for common causes independent of Pi-hole versions, e.g. users having closed a DNS loop, which would affect both Pi-hole 5 and Pi-hole 6 in the same way, or reducing database retention.
(Click for details on how changing maxDBSdays could cause temporary high CPU loads.)
Also, observing a temporary high CPU load for an extended period immediately after upgrading successfully could be expected:
When upgrading from Pi-hole 5 to Pi-hole 6, the default database retention period will be changed to 91.
If the previous default of 365 days would have been used with your Pi-hole 5, the database engine will be busy marking 274 days worth of data as deleted after upgrading to Pi-hole 6.
Depending on how large your Pi-hole 5 query database was, and on the hardware that runs your Pi-hole, and on your Pi-hole 5's MAXDBDAYS, this may take a long time and consume a lot of CPU cycles.
Thus, you may indeed observe Pi-hole 6 as being slow initially, even if the upgrade itself has finished minutes ago.
Obviously, that effect would hit hardest on low performance CPUs like the original RPi 1 or Zero single core platforms holding a large query database.
Once all data has been marked as deleted, Pi-hole's operation should return to previous levels.
However, since you are about to do a fresh install of Pi-hole 6, you could avoid DNS loops, and you won't be affected by database trimming, so you probably should consider to start with Pi-hole 6 straight away.
That's what has been discussed in the thread that vmmatty linked, and additionally, bcutter has also covered that by kindly providing a fresh version of his adopted installation script, as asked for by vmmatty.
My reply was geared specifically to the GitHub issue that vmmatty has linked, to explain some common conditions that could be expected to cause (temporary) high CPU load.
That’s correct, I was looking for a way to do a fresh install of v5 of Pihole due to the issues I’ve heard about in the v6 release. It’s unclear in that Github issue if the problem only occurs on v5 to v6 upgrades or on all v6 installs, but I know that v5 has worked for a very long time for me and I don’t see a reason to upgrade if there are potentially unaddressed issues.
A big thank you to @bcutter for supplying the script. It worked perfectly and I’ve got a clean v5 install up and running. Thank you again!