Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Losing jupyter notebook ssh connection kills kernel

I have an Ipython Jupyter kernel running on in an AWS VPN that I tunnel to a port my laptop where I connect to with a browser. I am finding that the kernel dies whenever I lose the tunnel and I have to run my notebook from the beginning.

What is the likely cause of this and how can I prevent it?

It is only the notebook kernels that die, the notebook server stays up.

like image 865
Daniel Mahler Avatar asked Mar 11 '16 04:03

Daniel Mahler


1 Answers

I admit that this seems odd. I wonder if there is something in the notebook that is killing the kernel. This can happen. You may have already done this, but try a really simple notebook, like a=10, drop the connection, and then see if you can print(a) after you recoennect.

However, the way to avoid the problem altogether is to use screen or tmux to create persistent sshs session. That is what many people who work on remote servers do.

like image 86
abalter Avatar answered Nov 12 '22 07:11

abalter