Extremely slow kernel starts

3,666 views
Skip to first unread message

Tom Baldwin

unread,
Mar 11, 2016, 7:00:47 PM3/11/16
to Project Jupyter
Hello group, I'm stuck tracking down a problem in both of my Jupyter installations and I'd love to hear some ideas of things to try.

I am experiencing very slow kernel starts in the Jupyter notebook. Sometimes kernels are ready right away after creating/opening a notebook, but more commonly I need to wait a minute or more before I can execute cells.

This is using Jupyter 4.1.0, Python 3.4, and Chrome. I've attached the text from Chrome's js console and the terminal output (from ``jupyter notebook --debug``).

When I e.g. open a new notebook, the circle in the upper right is closed in and syntax highlighting does not work. The last message in the terminal is

    [D 16:40:24.305 NotebookApp] 304 GET /nbextensions/widgets/notebook/js/extension.js (::1) 0.88ms

While the JS console has a warning

    actions jupyter-notebook:find-and-replace does not exist, still binding it in case it will be defined later...

If I attempt to execute cells during this time, the JS console displays the message

    main.min.js:21623 Can't execute, kernel is not connected.

Occasionally, there will also be a message in the JS console

    main.min.js:33736 ipywidgets package not installed.  Widgets are not available.

but not always.

Eventually (after more than a minute), the kernel connects, according to the JS console. I still cannot execute cells, but they fail in a different way. If I try to execute a cell, an asterisk is produced in the brackets instead of a message in the JS console.

During this second period of waiting, the terminal sporadically reports progress, but has some timeout messages such as

    [W 16:41:49.714 NotebookApp] Timeout waiting for kernel_info reply from 2b8be6e3-f5c7-4ee5-b38b-48cdab20617a

After another minute or so of waiting, this second period of waiting comes to a close with the terminal message

    [D 16:42:56.981 NotebookApp] Received kernel info: {'implementation': 'ipython', 'implementation_version': '4.1.2', ...

Which I've truncated for clarity. The kernel_ready message appears in the JS console, and I can use the notebook as normal after that with no delays (until I restart the kernel and the same thing happens).

Based on some searching I thought that it might be due to a rogue notebook extension. I tried disabling them all (by deleting the nbextensions folders in each of the data paths given by ``jupyter --paths``) but this solves no problems.

I'd love to hear any ideas on what to check next in order to track down the source of this problem. Thanks in advance for your thoughts.

terminal_output.txt
js_output.txt

MinRK

unread,
Mar 14, 2016, 8:06:38 AM3/14/16
to jup...@googlegroups.com
The fact that it takes so long for the kernel_info_reply to arrive suggests that something is actually taking a long time to load in starting up the kernel. Taking more than a few seconds is quite unusual for IPython. How long does it take you to start terminal IPython? Do you have any startup files or `exec_lines` in your IPython configuration?

-MinRK

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/5cac43c1-e10e-4acf-804f-d554748534e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Baldwin

unread,
Mar 14, 2016, 2:43:01 PM3/14/16
to Project Jupyter
Thanks for your reply, Min. Terminal IPython starts right away, taking about a second. My ``profile_default`` folder contains no ``.py`` files at any level, so there are neither startup nor config files as far as I know.

tk

On Monday, March 14, 2016 at 5:06:38 AM UTC-7, Min RK wrote:
The fact that it takes so long for the kernel_info_reply to arrive suggests that something is actually taking a long time to load in starting up the kernel. aking more than a few seconds is quite unusual for IPython. How long does it take you to start terminal IPython? Do you have any startup files or `exec_lines` in your IPython configuration?

-MinRK

Greg Yang

unread,
Apr 30, 2016, 4:34:29 PM4/30/16
to Project Jupyter
Long restarts happen to me as well over different machines. It's quite annoying.

chriddy

unread,
Sep 22, 2016, 8:48:58 AM9/22/16
to Project Jupyter
Same issue here on Windows 7. Console output is attached. Note how each of these connection attemps to localhost takes 3 secs:

[D 14:39:15.003 NotebookApp] Connecting to: tcp://127.0.0.1:53196
[D 14:39:18.008 NotebookApp] Connecting to: tcp://127.0.0.1:53197
[D 14:39:21.010 NotebookApp] Connecting to: tcp://127.0.0.1:53198

Might this in fact be a networking issue?
console_output.txt
Reply all
Reply to author
Forward
0 new messages