How to avoid multiple kernels per notebook?


I have a Jupyterlab server running on my workstation at my office. When I go home, I work at my laptop (connected via VPN to my office network) and I connect to JupyterLab in my workstation. As a result, I end up with several kernels for each notebook, as you can see in the attached image, which is a bit annoying (and a bit wasteful, I guess). Is there any way to avoid this?


Found out that this is an open issue: Duplicate kernels with jupyterlab on remote machine · Issue #8574 · jupyterlab/jupyterlab · GitHub

1 Like

I wonder if this is the same issue as browser tab has old kernel id after ssh tunnelled connection broken · Issue #11303 · jupyterlab/jupyterlab · GitHub. If you encounter the same next time, could you please try to refresh the browser tab (after re-establishing VPN and tunnel [if you use a tunnel in addition to VPN]) rather than click on “No Kernel”? This workaround works for me (the old kernel reconnects properly).

Not sure if it can be the same problem or not. In my case I never click on “No Kernel”. I just open the JupyterLab webpage (via VPN connection to my workstation at work, no need for tunnel), and load the Workspace I’m working with. The Notebooks seem to use the first kernel sometimes, but in some others they start a new one and then see duplicated ones.

For example, yesterday I cleaned up the kernels, updated jupyterlab to the latest version (hoping something might have improved in last weeks), restarted the server and started working as usual. Since then I have probably loaded the page in two different computers about at least 10 times, and most of the times I could see only one set of kernesl (one for notebook), but then at some point they got duplicated and now I have two kernels per notebook.

(edited: after reading carefully browser tab has old kernel id after ssh tunnelled connection broken · Issue #11303 · jupyterlab/jupyterlab · GitHub, my problem seems to be a different one, since I never have to specify which kernel to use, I just reload the page, or just wait some time, and the connections are there again, but as I said, sometimes the kernels seem to get duplicated for some reason, but I have no idea how I could debug this)

1 Like