Skip to main content
  1. Python3
  2. Multi-user kernels in Mage Pro
  3. Restart kernel

Python3 kernel

Python3 is the default kernel. You can prototype and transform small to medium size datasets with this kernel. Pipelines built with this kernel can be executed in Python environments.

Multi-user kernels in Mage Pro

Mage Pro can run a separate Python kernel for each authenticated user in the pipeline editor. This lets multiple users run blocks at the same time without sharing one notebook kernel, execution queue, or output stream. Enable the feature by setting the following environment variable on your Mage Pro cluster:
MULTI_USER_JUPYTER_KERNELS=1
When this setting is enabled:
  • Each authenticated user gets an isolated Python kernel for interactive block execution from the pipeline editor.
  • Kernel output is routed only to websocket clients for the user that started the block run.
  • Interrupt and restart actions apply to the current user’s kernel.
  • Idle kernels without connected websocket clients are cleaned up automatically.
You can tune resource cleanup with:
VariableDescriptionDefault
JUPYTER_KERNEL_IDLE_TIMEOUT_SECONDSNumber of seconds an inactive user kernel can stay alive after its websocket clients disconnect.1800
JUPYTER_KERNEL_MAX_PER_SERVERMaximum number of user kernels to keep on one Mage server. When the limit is reached, Mage evicts idle kernels first.50
For debugging, admins can list all active user kernels with:
GET /api/kernels?include_all=1
By default, GET /api/kernels only returns the kernel for the current user.
Multi-user Jupyter kernels are a Mage Pro feature. Mage uses the Python3 kernel for this mode; the legacy PySpark notebook kernel is not supported.

Restart kernel

If your block execution is hanging in the notebook and no block output is printed, you can try interrupting the block execution and restarting the kernel. You can find the “Restart kernel” button in the “Run” menu at the top of the notebook.