OctoPrint has become extremely slow to respond

What is the problem?

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.

Have you tried running in safe mode?

yes

Did running in safe mode solve the problem?

no

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
octoprint-systeminfo-20250814235938.zip (397.0 KB)

Additional information about your setup

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

Have you already cleared the browser cache (Crtl-F5) from time to time?

Yes, that's my standard go-to when I have a browser glitch (along with restarting PC)

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).

Will post back here if I need more help.

1 Like

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

#3) Upload via API and time it

curl -sS -H "X-Api-Key: <YOUR_API_KEY>"
-F "file=@/tmp/mini2.gcode"
http://<YOUR_PI_IP_ADDRESS>/api/files/local
-o /dev/null -w "HTTP %{http_code} in %{time_total}s\n"

#4) Immediately query the file

curl -sS -H "X-Api-Key: <YOUR_API_KEY>"
http://<YOUR_PI_IP_ADDRESS>/api/files/local/mini2.gcode
-o /dev/null -w "GET file: HTTP %{http_code} in %{time_total}s\n"

The expected output if too many files was also your problem

Your HTTP 201 should be <1 s
Your GET for the file should return HTTP 200 in < 2s (not >50s)

Hope it helps someone

Potentially related to High CPU usage due to excessive polling of file metadata Β· Issue #5193 Β· OctoPrint/OctoPrint Β· GitHub, do you happen to have the dashboard plugin installed?