Notebook: Running Notebooks/Terminals - Shutdown automatically after specified time

Created on 4 Apr 2016  路  9Comments  路  Source: jupyter/notebook

I am using Jupyter notebook in a multiuser mode , means many people are running their notebooks in their specified folders in a shared environment. One problem which I can see is that even if they logged out , their notebooks/terminals keeps on running forever , so every now and then I have to go the running tabs and "Shutdown" the notebooks and terminals manually. Is there a way with which we can shutdown the notebooks and terminal after a specified time ?

Most helpful comment

From 5.3 (#2963), it should be possible to cull idle servers with config like this:

c.MappingKernelManager.cull_idle_timeout = 600
c.NotebookApp.shutdown_no_activity_timeout = 600

The first option culls idle kernels after ten minutes. The second shuts down the server 10 minutes after the last kernel was shut down.

All 9 comments

Do you mean you're using Jupyterhub? If so, there is a script here which can cull idle servers periodically:

https://github.com/jupyter/jupyterhub/blob/master/examples/cull-idle/cull_idle_servers.py

No its not Jupyterhub .. its just a normal single instance of Jupyter which is password protected and our whole team login to it using https://server-ip:8888/tree

OK. Then no, at present there is nothing like that, but we're talking about adding some functionality to make it possible, in #1241.

@shamsulbuddy : We're doing a little housekeeping on our issue log and noticed this thread from 2016. Has this issue been resolved to your satisfaction and can it be closed? thanks!

Hi,

I think this functionality should be implemented.
We are also running a multi user envoirment, with JupyterHub and shutting down idle servers.
However, if people keep working during the day, the number of open notebook kernels stacks up quite high.

Maybe a flag that could be set such that kernels for which there is no current browser tab open shuts down after a while. My experience is that most people shut down the browser tab and excpect the kernel to stop from this.

Culling idle kernels is coming in 5.1, see #2215.

Also #2498 for extra config options.

@nabriis May I know, how exactly are you culling idle servers ?

From 5.3 (#2963), it should be possible to cull idle servers with config like this:

c.MappingKernelManager.cull_idle_timeout = 600
c.NotebookApp.shutdown_no_activity_timeout = 600

The first option culls idle kernels after ten minutes. The second shuts down the server 10 minutes after the last kernel was shut down.

Was this page helpful?
0 / 5 - 0 ratings