Forums

CPU usage history (can't figure out what is using CPU time)

Hi,

I just got an email saying that I had maxed out my CPU usage. Over the past few months of hosting my website here I have never reached close to the limit (except on a few days several weeks ago when I ran a Jupyter notebook for a separate project but never exceeded the CPU usage limit). Over the past 24h I haven't modified any of my scripts and as such I don't understand the spike. Is there any CPU log where I can see which scripts have been using the CPU?

I'd appreciate any help you can offer.

Since then I looked in the Console tab at the processes which are currently running. It appears that some Jupyter notebook has been running a process since the 10th of may. I subsequently killed those processes. I am unsure as to why these were still running in the background. The CPU usage has since stopped increasing so the issue appears to be resolved. Feel free to delete this post.

Jupyter notebooks do carry on running, even when you're not viewing them -- that's deliberate, as it allows you to kick off a long computation, then close the window while it works, and come back to it later when you want to see the results, maybe even from another machine.

The less-helpful thing about them is that they "sip" CPU even when they're idle -- that is, you can open a notebook, close it, and then find that it's used about a CPU-second per minute even though it wasn't doing useful work :-(

How do you prevent this from happening? Is there a way to "deactivate" an existing notebook.

I just stopped the kernel on all my notebooks as a test to see if this helps.

You can use the "Fetch process list" button on the Consoles page and then kill the process from there.