I learned a few things from @minrk on gitter (February 1, 2023 6:36 PM) that I want to ensure is captured in this repo.
My takeaway points from what Min said
- server will not shut itself down if it has a stuck-busy kernel, but [jupyterhub-idle-culler] will
- It’s in what the server considers activity to be reported. Messsged are activity (execution, output), but being statically busy is not considered activity.
- It’s in our power to change this - the hub singleuser activity tracking could be modified to consider (separately, even) busy and/or connected kernels to be “active”
- So if you changed one big sleep to a for/print every minute or two, it should stay up.
Gitter discussion
Me:
I'm at a loss. Shouldn't starting a notebook running in jupyterlab, like below, make it end up >reporting regularly that its active, which makes z2jh's culler not cull the instance?
import time
time.sleep(3600*24)
Apparently, it doesn't seem to help.
Min:
Is the lab tab still open and connected?
If not, then no. Culler doesn’t consider a notebook not being interacted with activity.
It’s in our power to change this - the hub singleuser activity tracking could be modified to consider (separately, even) busy and/or connected kernels to be “active”
Me:
Hmm @minrk no, when you say "Culler", which culler are you speaking about? The jupyterhub-idle-culler?
I thought that the jupyterhub-idle-culler got reports about kernel activity, and that was sufficient.
Are you saying that the jupyterhub-idle-culler is aware of the kernel activity, but disregards it?
Min:
Sorry, not clear. It’s in what the server considers activity to be reported. Messsged are activity (execution, output), but being statically busy is not considered activity.
So if you changed one big sleep to a for/print every minute or two, it should stay up.
What I mean is that we could in JuoyterHub (or Jupyter server) add checks for busy kernels to ensure they are considered active if busy.
We can have config for this to make it opt-in or out.
The server’s internal culler does have a switch for this - cull_busy_kernels, I think? It’s off by default, so there is a difference there - server will not shut itself down if it has a stuck-busy kernel, but Hub will.
The internal culler has lots more fine-grained info to make decisions with, so I think it should do a better job in general with shorter deadlines, and the hub culler ought to have quite a long one most of the time.
But I think I’ve also seen the internal one fail to shutdown when it should, where the hub cull is very reliable to shutdown when it thinks it should
I learned a few things from @minrk on gitter (February 1, 2023 6:36 PM) that I want to ensure is captured in this repo.
My takeaway points from what Min said
Gitter discussion
Me:
Min:
Me:
Min: