Printer frontend stops responding

From time to time, the web UI just hangs. I get the message that the page is initializing, and it just sits there. From time to time, after many minutes, it'll load back up. Others, it won't. The printer itself continues to print and nothing else seems to be out of whack. I do however also note that since a couple of weeks ago, it seems the web UI takes a lot longer to load than usual. Attached, the logs. Just happened again not even 20 minutes ago, just before I started writing this post. Hung for a full 10 minutes or so, and wouldn't reload during that time. It doesn't error out on mu... just sits there... initializing. Also, the CPU goes up as high as close to 90% at times. Image attached. Pi temperature is at 40-41 degrees C. I did think that maybe it could be the CPu that is overtaxed, though I can't figure out why now, and not before. And also, this behavior also happens when the printer is at idle, waiting for a new print.
No description
15 Replies
blacksmithforlife
CPU at 90% is suspect. Even under heavy load mine doesn't go above 30% load. If you ssh into the machine and run top what are the processes that are using the most CPU?
NMGMarques
NMGMarquesOP3y ago
This is what I see:
NMGMarques
NMGMarquesOP3y ago
No description
blacksmithforlife
So you see the top line (PID 592)? See how the CPU is 197.4%. that means that of the available CPU resources(100%) it is asking for 197.4%. This is obviously bad and why it doesn't have the resources to deal with the web page requests. So, to get the full command that is running (cause it is just showing python). Run ps -p 592 -o args
blacksmithforlife
The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time.
In a true SMP environment, if a process is multi-threaded and top is not operating in Threads mode, amounts greater than 100% may be reported. You toggle Threads mode with the `H' interactive command.
Also for multi-processor environments, if Irix mode is Off, top will operate in Solaris mode where a task's cpu usage will be divided by the total number of CPUs. You toggle Irix/Solaris modes with the `I' interactive command.
From the manual for top https://manpages.org/top
man top (1): display Linux processes
man top (1): The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. The types of system summary information shown and the t
blacksmithforlife
In case you were wondering how above 100% was possible
NMGMarques
NMGMarquesOP3y ago
Ok. So that returned:
NMGMarques
NMGMarquesOP3y ago
No description
NMGMarques
NMGMarquesOP3y ago
Meaning it's the telegram bot, right? I think i might know the issue if that is the case.
blacksmithforlife
Looks like it
NMGMarques
NMGMarquesOP3y ago
I am 10 minutes away from completion of the current print, and I'll test my theory. I think the parameters for the bot might be too agressive. I just noticed that the bot is updating the image every 5 seconds. I'll change that and give it a new test. The bot was updating way too frequently and also creating a time lapse using images taken every 5 seconds. I reduced everything (or increased, however you want to look at it) and set the refresh to once a minute and the time lapse to a minute every 10 seconds. Giving it another go, but so far, seems much better. Thanks @blacksmithforlife !
extended-salmon
extended-salmon3y ago
I know this is sovled and I agree that 200% was way to high but I just wanted to chime in to say that this is not how linux scheduling works. Where windows puts the entire CPU into one pool and will give you a percentage based on that, linux will show a percentage based on a single core. This means that if you have a quad core cpu (like the pi) the numbers can be as high as 400% (100% per core).
NMGMarques
NMGMarquesOP3y ago
I actually have to come back to this. I am still having the issue. Turned off the printer last night, back on this morning... from fresh start, took me over 5 minutes to finally be able to get to the user interface.
NMGMarques
NMGMarquesOP3y ago
No description
blacksmithforlife
which is why I posted the exact definition from the top man page, but you are right my first definition was wrong
Want results from more Discord servers?
Add your server