OctoPrint web interface has become incredibly slow to load. Using Raspberry Pi 3b. Problem only started recently after a few months without using the printer.
Only command line on rpi, and unsure how best to monitor. After restart, cpu utilisation is high for about 30 seconds and UI responds. If I attempt to refresh the page (as often prompted to reload), the UI disappears for minutes and top shows minimum utilization (<3% for any process). By example, restarted OctoPrint at UI, UI responded within 30 seconds, then on browser refresh UI went white for over 4 minutes until OctoPrint UI returned.
What did you already try to solve it?
Restarted in safemode, same problem
I kept a lot of gcode files on the rpi, deleted them in case it was causing the slowdown. No obvious effect.
OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
OctoPrint 1.11.2
Raspbery Pi 3b 1.2
Prusa i3 MK3S+
Google Chrome 139, Windows 11
Fault-finding has indicated a network problem (wow), why did it only effect OctoPrint?).
I'm still investigating, as OctoPrint's general response is sluggish, but the UI is now consistently loading in under a minute (with or without safemode).
Can confirm fault was entirely with network. Symptoms were very slow UI load. In fact, I believe connectivity between the browser and OctoPrint server were being disrupted, and only OctoPrint's robust retry methods of reconnecting from the browser were finally getting a UI load. This type of fault would be pretty uncommon amongst modern network equipment - there were high rates of packet loss and latency involved.
I was also seeing problems with slow updates of the upload file list on 1.11.3:
The symptoms I had was after a restart of the Octoprint service and webpage had reloaded, it took >2min for the uploaded files list to be populated and any new file only appearing >1min after an upload.
I explored a few things but, I had a simpler issue, I had too many files in the ~/.octoprint/uploads.
Striping that down to < 10 files changed the response time on both restart files list and new uploads appearing at < 0.1sec.
Here are some details of the testing commands I used that may be useful.
open a command line and ssh into your pi
1) Restart OctoPrint
Note: I have upgraded my python top 3.12 hence the unusual service name octoprint312
Your service will have a different name likely just octoprint
sudo systemctl restart octoprint312
#2) Make a tiny test file and upload
printf "; tiny test 2\nG28\nM84\n" > /tmp/mini2.gcode
ls -lh /tmp/mini2.gcode