I would like to cull the idle jhub kernels which are idle for 12 hours. I would like to check every 1 hour interval. I am going to use jupyterhub-idle-culler-service. Setting --timeout=43200 will cull 12 hours idle kernel? How can I set the interval
1)
c.JupyterHub.services = [
{
“name”: “jupyterhub-idle-culler-service”,
“command”: [
sys.executable,
“-m”, “jupyterhub_idle_culler”,
“–timeout=3600”,
],
“admin”: True,
}
]
c.JupyterHub.load_roles = [
{
“name”: “jupyterhub-idle-culler-role”,
“scopes”: [
“list:users”,
“read:users:activity”,
“read:servers”,
“delete:servers”,
“admin:users”, # if using --cull-users
],
# assignment of role’s permissions to:
“services”: [“jupyterhub-idle-culler-service”],
}
]
what is the difference between using jupyterhub-idle-culler-service and below two options. For my requirement which is the best option
2)
MappingKernelManager.cull_busy =True
Thanks a lot @manics. It resolved the issue and I could auto cull the kernel.
After culling when I login to the Jhub, the server itself restarting again. Is it expected. Is there a way to just cull the kernel. Below is the config that I used for testing. Is it due to the property in the scope “delete:servers”.
My requirement is to just stop the long running notebook to free up resources. Please clarify
Also I assume after the culling, do we have to run the paragraph from the beginning again and we can not continue from where we left before culling? Please confirm.
Have a read through this, it explains some of the complexity behind culling servers/kernels:
I’m not sure what you mean by “paragraph”, do you mean a notebook cell? If so then you’ll have to run the notebook again from the beginning, since killing a kernel means all your internal state is lost.