how to enforce one running kernel per user?

23 views
Skip to first unread message

iv...@uchicago.edu

unread,
Jun 7, 2017, 3:26:47 PM6/7/17
to Project Jupyter
Hi All,
I'd like to enforce that each user runs only one kernel in JupyterHub at a time and when a new kernel is started the old one is killed. The default JupyterHub behavior practically encourages that users keep their old sessions running. That creates problems for pyspark since Hadoop allows only fixed number of pyspark sessions running at a time (by default 16 but it is configurable). Is there some configuration parameter for this?
Thank you,
Igor
 

Roland Weber

unread,
Jun 8, 2017, 1:39:26 AM6/8/17
to Project Jupyter
Hello Igor, 

there's no config parameter for this, afaik. The kernel gateway has a parameter to limit the number of kernels, but the notebook server does not. And even the kernel gateway will not automatically stop a running kernel. Rather, it would refuse to create new kernels until an old one has been stopped.

You could implement and configure a custom kernel manager that does what you want. See config property "NotebookApp.kernel_manager_class".

hope that helps,
  Roland
Reply all
Reply to author
Forward
0 new messages