自动关闭非活动的 ipython 笔记本



有没有办法将ipython notebook配置为不让非活动笔记本进程无限期地保持活动状态?例如,每当客户端断开连接或在空闲 n 分钟后自动关闭笔记本。

此功能是在 5.1 版中添加的。请参阅以下问题和拉取请求

  • https://github.com/ipython/ipython/issues/5539
  • https://github.com/jupyter/notebook/pull/2215

> 2021 年的解决方案

~/.jupyter/jupyter_notebook_config.py或配置文件中设置以下值

c.MappingKernelManager.cull_busy = False
c.MappingKernelManager.cull_connected = False
c.MappingKernelManager.cull_idle_timeout = 86400

其中 86400 表示 1 天 (= 86400s)。

参见

  • https://github.com/jupyter/notebook/pull/2215
  • https://discourse.jupyter.org/t/which-is-the-correct-way-to-cull-idle-kernels-and-notebook/8123

不,没有配置选项。请随时提交问题以请求该功能。

最新更新