Web interface slow after update from 5 to 6

Expected Behaviour:

Web interface is responding slowly after I upgraded pihole from version 5 to 6 (pihole -up)
Using chrome browser.
Using https://piholeip/admin/

Actual Behaviour:

Graphs are loading really slowly and sometimes not at all

Debug Token:

https://tricorder.pi-hole.net/a1WtQbIt/

Long storry short : I was very happy with v5 but all of a sudden dns query were not resolved using cloudflare dns. So I updated :smile:
Now clouflares resolving still do not work, but also my web gui.
I see lighthttp errors in the log, but not sure how to fix that.
Also at first web interface wasn't working at all so I ran those command lines I found on another topic :smile:
sudo chmod 755 /var/www
sudo chmod 755 /var/www/html

Thanks for your help :smiley:

When you updated, did you select the option to remove lighttpd?

1 Like

I don't remember having this choice.

If I browse to

  1. http://pi.hole/admin
  2. http://pi.hole/

I have a 403 Forbidden message (might be lighthttpd answering)

Also I notice the CPU is overloaded (200+ %), it wasn't the case before upgrade.

Yes... lighttpd is still running:

[✗] tcp:0.0.0.0:80 is in use by lighttpd

If you are not using it to serve other interfaces, you can safely disable it with:

sudo systemclt stop lighttpd.service
sudo systemclt disable lighttpd.service

Then restart pihole service to restart the new web server with:

sudo systemclt restart pihole-FTL.service
1 Like

Thank you.
Just did it.
Webgui is still loading very slowly

This screen is taken after 5 minutes load

and DNS resolving is not working anymore :face_with_diagonal_mouth:

New debug file after applying lighthttpd fix
https://tricorder.pi-hole.net/yDVSnKCY/

And CPU usage :

Can you please try use http (without the s)?

1 Like

Same behaviour

I was able to access this message in pihole diagnosis :smile:

WebGui ran smoothly for a few minutes and went back to eternal load time again.
Might be my hardware being outdated now.. V6 is too demending.

What hardware are you running? I have V6 running on a Pi Zero W (pretty lightweight CPU) with no problems. Fast and responsive.

1 Like
*** [ DIAGNOSING ]: System hardware configuration
[i] lshw -short
H/W path  Device  Class      Description
========================================
                  system     Raspberry Pi Model B Rev 2
/0                bus        Motherboard
/0/0              processor  cpu
/0/1              memory     429MiB System memory
/1        usb1    bus        DWC OTG Controller
/1/1              bus        USB hub
/1/1/1    eth0    network    Ethernet interface

*** [ DIAGNOSING ]: Processor details
[i] lscpu
Architecture:        armv6l
Byte Order:          Little Endian
CPU(s):              1
On-line CPU(s) list: 0
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           1
Vendor ID:           ARM
Model:               7
Model name:          ARM1176
Stepping:            r0p7
CPU max MHz:         700.0000
CPU min MHz:         700.0000
BogoMIPS:            697.95
Flags:               half thumb fastmult vfp edsp java tls

I noticed that :
*** [ DIAGNOSING ]: Pi-hole FTL Query Database
-rw-r----- 1 pihole pihole 1.5G Feb 21 03:33 /etc/pihole/pihole-FTL.db

Can this be an issue ? <= EDIT : This is the issue

I guess the bottleneck is the CPU overload.
I stopped pihole service and CPU is quite iddling now (sudo systemctl stop pihole-FTL)
Can there be an issue with my gravity list (quite large around 800k entry) ?
But it runned fine with pihole v5

Does it need a rebuilt/repair ?

Thanks

I have 1.5mln and no problem when using plain http (same hardware). It took a while for my RBP to settle down after the upgrade (and a reboot ...)

2 Likes

Ok I think I solved it.

Before reinstalling from scratch and restoring config backup, I gave this a try :

sudo du /etc/pihole/pihole-FTL.db -h
DB was 1.5Gb
sudo pihole flush
sudo systemctl stop pihole-FTL
sudo rm /etc/pihole/pihole-FTL.db
sudo systemctl start pihole-FTL
sudo du /etc/pihole/pihole-FTL.db -h
DB is 92K

Now pihole CPU usage is back to something acceptable and GUI is browsable.

I lost the log though :man_shrugging:

Credits to this Reddit thread : https://www.reddit.com/r/pihole/comments/1iss62l/pihole_v6_extremely_slow_gui_high_cpu_usage/
And this page :Free Up Pi-Hole Disk Space Usage

Thank you all for looking into this.
Hope this can help others.

1 Like

The default database log lifetime has been reduced from 365 to 91 days. Is that log actually truncated during migration?

And the high CPU usage is only there while the web UI is loading, right? So it seems like the database backend of the web UI has issues with large databases in certain cases. Having the lifetime reduced may help (no one needs a full year of query logs by default :smile:), so if it is currently not truncated during migration, that can further help for migrated setups, before having a look into why CPU usage can go up that high.

Does memory usage raise significantly when accessing the web UI? I see 30.9% on the screenshot, but not sure whether this includes swap space or not. Possible that the database backend loads too much of the database into memory, leading to swapping, which is extremely slow with an SD card. Just an idea. ... there are two reports on GitHub where memory usage goes up, but not that much, with at least only some of the swap space used:

EDIT: Seems DL6ER is on it.

1 Like

Is that log actually truncated during migration?

Can't say. but it seems not.

And the high CPU usage is only there while the web UI is loading, right?

I would say no. It was between 200% and 400% usage 7 hours after upgrade/reload

Does memory usage raise significantly when accessing the web UI?

It seems yes. And stays like this even if swap lowered.

but not sure whether this includes swap space or not.

Swap raised up to 100% (mine is 100Mb) but slowly reduced to 20%

Having the lifetime reduced may help (no one needs a full year of query logs by default :smile:)

I set it to 61 days. But might lower it a bit more later in case file is getting big. A week of logs would be enough for a familly usage. :grin:

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