KernelLimit
def KernelLimit(
msg, candidate:NoneType=None, limit:int=0
):The ceiling is reached. candidate is a kernel that can be offered to close, or None while all are busy.
Keep one kernel per key and enforce a shared kernel limit.
The host-prefixed KERNEL_IDLE environment variable overrides IDLE_SECONDS.
The ceiling is reached. candidate is a kernel that can be offered to close, or None while all are busy.
KernelLimit reports the configured limit and an optional kernel that could be closed.
A ceiling across every pool in this process. Never evicts a namespace somebody is using.
RuntimeBroker counts live kernels across registered pools. admit raises KernelLimit when the next kernel would exceed max_kernels.
Live kernels, keyed by an id the host assigns: usually a tab, a notebook or a folder.
KernelPool.get starts at most one kernel for each key. Concurrent callers wait for the same start. Failed starts are not stored.
{'kernel': 'ipymini', 'python': '/proj/.venv/bin/python'}
_class_for selects the runner for a language and transport. The gateway transport supports Python only.
('GatewayKernel', 'Kernel', 'direct')
reap closes kernels idle for at least idle seconds. Busy kernels are kept. idle=0 disables reaping.
(['stale'], ['fresh', 'working'])
The examples use stand-in kernels and do not start child processes.
{'live': 2,
'limit': 2,
'runtimes': [{'key': 'one',
'pid': 4242,
'kind': 'ipykernel',
'cwd': '/proj/one'},
{'key': 'two', 'pid': 4242, 'kind': 'ipykernel', 'cwd': '/proj/two'}]}
status lists current kernels. _candidate selects the stalest idle kernel that could be closed.
('one',
{'key': 'one',
'name': 'one',
'cwd': '/proj/one',
'pid': 4242,
'idle_for': 90})
Without automatic management, admit reports a candidate and closes nothing.
kernel limit reached (2); close an idle runtime or set KUNDA_MAX_KERNELS to a larger value
one 2
When every kernel is busy, candidate is None.
kernel limit reached (2) and every runtime is busy; stop one or set KUNDA_MAX_KERNELS to a larger value
None None
With auto_manage=True, admit closes the stalest idle kernel and returns its description.
('one', [], 0)
The pool passes known_kernels and install_hints to local Kunda kernels.
'no Jupyter kernel is installed for rust. Install one with `cargo install evcxr_jupyter`.'
Pool and broker environment variables use the host prefix set by use_app.