To improve resource management, every user server that’s not actively being used, it’s shut down by the jupyterhub
Since the server’s kernel activity counts as server activity, the idle-culler also operates at a kernel level. This means that if a user leaves a notebook with a running kernel, the kernel will be shut down, if idle for the specified timeout period.
User server culling configuration¶
To configure the server’s different culling options, these options must be specified on a per-hub basis, under the appropriate configuration file in config/clusters.
Example:
jupyterhub:
cull:
# Cull after 30min of inactivity
every: 300
timeout: 1800
# No pods over 12h long
maxAge: 43200More culling options and information about them can be found in the idle-culler documentation.
Kernel culling configuration¶
The kernel culling options are configured through the jupyter_server_config.json file, located at /usr/local/etc/jupyter/jupyter_server_config.json in the user pod. This file is injected into the pod’s container on startup, by defining its location and content under singleuser.extraFiles dictionary.
You can modify the current culling options values, under singleuser.extraFiles.data, in the helm-charts/basehub/values.yaml file.
Example:
singleuser:
extraFiles:
jupyter_server_config.json:
mountPath: /usr/local/etc/jupyter/jupyter_server_config.json
data:
MappingKernelManager:
# shutdown kernels after no activity
cull_idle_timeout: 3600
# check for idle kernels this often
cull_interval: 300
# a kernel with open connections but no activity still counts as idle
cull_connected: true