Python kernel takes long time to get ready after starting

1,096 views
Skip to first unread message

Greg Yang

unread,
Oct 5, 2015, 3:00:43 AM10/5/15
to Project Jupyter
I have a jupyter server running in a ubuntu VM in a desktop, and I'm accessing it through my home LAN on another computer.

If I restart my python kernel in Jupyter, the kernel will show up "kernel created" but sometimes won't be ready for minutes: I can't execute any cell. My network has no problems, since I can stream high definition videos just fine. On the terminal on the jupyter server, the only message is "Kernel restarted: [kernel identifier]" and there is no indication of any error.

Is this the expected behavior? Can I tweak this to make the kernel ready to go faster?

MinRK

unread,
Oct 5, 2015, 4:53:11 AM10/5/15
to jup...@googlegroups.com
Can you start the server with `--debug` and provide any log output from the terminal and also from the javascript console when this is happening? I haven't seen an IPython kernel take more than a couple of seconds to become available.

-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/420f4fe5-e2a1-4b7f-badb-e8e3f0222b46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Baldwin

unread,
Oct 17, 2015, 2:47:29 PM10/17/15
to Project Jupyter
I'm not OP, but I am seeing the same behavior. Every kernel start or restart takes at least a minute. I'm using the Anaconda distribution on OS X Yosemite. A reinstall didn't help - I wiped my entire anaconda directory, and replaced it with miniconda (the python 3 version), and I still see this happening.

The server starts up quickly (jupyter notebook --debug) and the browser opens. When I create a new notebook, it seems to start right away, but the console log says "Creating new notebook in ". No folder name. Syntax highlighting is not working, and I cannot execute any cell.

Then a long span of time happens (starting at 11:37:44 in the log below) when seemingly nothing is going on. Finally at 11:40:24 the syntax highlighting starts working and I can execute cells. Cells I selected to execute during the dead time need to be resubmitted.

I've included the console output below but it's not very illuminating to me.

tk


whark:~ tkb$ jupyter notebook --debug
[D 11:37:36.243 NotebookApp] Config changed:
[D 11:37:36.243 NotebookApp] {'NotebookApp': {'log_level': 10}}
[D 11:37:36.244 NotebookApp] Searching ['/Users/tkb', '/Users/tkb/.jupyter', '/Users/tkb/miniconda3/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 11:37:36.245 NotebookApp] Attempting to load config file jupyter_config.py in path /etc/jupyter
[D 11:37:36.245 NotebookApp] Attempting to load config file jupyter_config.json in path /etc/jupyter
[D 11:37:36.245 NotebookApp] Attempting to load config file jupyter_config.py in path /usr/local/etc/jupyter
[D 11:37:36.245 NotebookApp] Attempting to load config file jupyter_config.json in path /usr/local/etc/jupyter
[D 11:37:36.246 NotebookApp] Attempting to load config file jupyter_config.py in path /Users/tkb/miniconda3/etc/jupyter
[D 11:37:36.246 NotebookApp] Attempting to load config file jupyter_config.json in path /Users/tkb/miniconda3/etc/jupyter
[D 11:37:36.246 NotebookApp] Attempting to load config file jupyter_config.py in path /Users/tkb/.jupyter
[D 11:37:36.246 NotebookApp] Attempting to load config file jupyter_config.json in path /Users/tkb/.jupyter
[D 11:37:36.246 NotebookApp] Attempting to load config file jupyter_config.py in path /Users/tkb
[D 11:37:36.247 NotebookApp] Attempting to load config file jupyter_config.json in path /Users/tkb
[D 11:37:36.247 NotebookApp] Attempting to load config file jupyter_notebook_config.py in path /etc/jupyter
[D 11:37:36.247 NotebookApp] Attempting to load config file jupyter_notebook_config.json in path /etc/jupyter
[D 11:37:36.247 NotebookApp] Attempting to load config file jupyter_notebook_config.py in path /usr/local/etc/jupyter
[D 11:37:36.247 NotebookApp] Attempting to load config file jupyter_notebook_config.json in path /usr/local/etc/jupyter
[D 11:37:36.248 NotebookApp] Attempting to load config file jupyter_notebook_config.py in path /Users/tkb/miniconda3/etc/jupyter
[D 11:37:36.248 NotebookApp] Attempting to load config file jupyter_notebook_config.json in path /Users/tkb/miniconda3/etc/jupyter
[D 11:37:36.248 NotebookApp] Attempting to load config file jupyter_notebook_config.py in path /Users/tkb/.jupyter
[D 11:37:36.248 NotebookApp] Attempting to load config file jupyter_notebook_config.json in path /Users/tkb/.jupyter
[D 11:37:36.251 NotebookApp] Loaded config file: /Users/tkb/.jupyter/jupyter_notebook_config.py
[D 11:37:36.252 NotebookApp] Config changed:
[D 11:37:36.252 NotebookApp] {'NotebookApp': {'port': 9999, 'browser': 'open -a /Applications/Google\\ Chrome.app %s', 'log_level': 10}}
[D 11:37:36.253 NotebookApp] Attempting to load config file jupyter_notebook_config.py in path /Users/tkb
[D 11:37:36.253 NotebookApp] Attempting to load config file jupyter_notebook_config.json in path /Users/tkb
[I 11:37:36.331 NotebookApp] Serving notebooks from local directory: /Users/tkb
[I 11:37:36.332 NotebookApp] 0 active kernels 
[I 11:37:36.332 NotebookApp] The IPython Notebook is running at: http://localhost:9999/
[I 11:37:36.332 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[D 11:37:36.783 NotebookApp] Using contents: services/contents
[D 11:37:36.846 NotebookApp] 200 GET /tree (::1) 64.90ms
[D 11:37:36.874 NotebookApp] 304 GET /custom/custom.css (::1) 17.11ms
[D 11:37:37.244 NotebookApp] 200 GET /static/services/contents.js?v=20151017113736 (::1) 3.50ms
[D 11:37:37.253 NotebookApp] 200 GET /custom/custom.js?v=20151017113736 (::1) 1.83ms
[D 11:37:37.306 NotebookApp] 200 GET /api/config/tree?_=1445107056998 (::1) 1.22ms
[D 11:37:37.308 NotebookApp] 200 GET /api/config/common?_=1445107056999 (::1) 1.21ms
[D 11:37:37.317 NotebookApp] 200 GET /api/terminals?_=1445107057000 (::1) 1.10ms
[D 11:37:37.323 NotebookApp] Native kernel (python3) available from /Users/tkb/miniconda3/lib/python3.4/site-packages/ipykernel/resources
[D 11:37:37.324 NotebookApp] Native kernel (python3) available from /Users/tkb/miniconda3/lib/python3.4/site-packages/ipykernel/resources
[D 11:37:37.325 NotebookApp] 200 GET /api/kernelspecs (::1) 4.72ms
[D 11:37:37.328 NotebookApp] 200 GET /api/terminals?_=1445107057002 (::1) 1.02ms
[D 11:37:37.332 NotebookApp] 200 GET /api/sessions?_=1445107057001 (::1) 2.97ms
[D 11:37:37.501 NotebookApp] 200 GET /api/contents?type=directory&_=1445107057003 (::1) 83.37ms
[I 11:37:43.401 NotebookApp] Creating new notebook in 
[D 11:37:43.491 NotebookApp] Saving /Users/tkb/Untitled9.ipynb
[D 11:37:43.502 NotebookApp] 201 POST /api/contents (::1) 102.26ms
[D 11:37:43.509 NotebookApp] Using contents: services/contents
[D 11:37:43.552 NotebookApp] 200 GET /notebooks/Untitled9.ipynb?kernel_name=python3 (::1) 44.55ms
[D 11:37:43.571 NotebookApp] 304 GET /static/components/MathJax/MathJax.js?config=TeX-AMS_HTML-full,Safe&delayStartupUntil=configured (::1) 1.93ms
[D 11:37:43.573 NotebookApp] 304 GET /custom/custom.css (::1) 1.57ms
[D 11:37:43.614 NotebookApp] 304 GET /static/components/MathJax/config/TeX-AMS_HTML-full.js?rev=2.5.3 (::1) 1.12ms
[D 11:37:43.888 NotebookApp] 304 GET /custom/custom.js?v=20151017113736 (::1) 1.16ms
[D 11:37:43.925 NotebookApp] 304 GET /static/components/MathJax/config/Safe.js?rev=2.5.3 (::1) 1.73ms
[D 11:37:43.946 NotebookApp] 200 GET /api/config/notebook?_=1445107063678 (::1) 1.25ms
[D 11:37:43.953 NotebookApp] 200 GET /api/config/common?_=1445107063679 (::1) 2.03ms
[D 11:37:44.024 NotebookApp] Native kernel (python3) available from /Users/tkb/miniconda3/lib/python3.4/site-packages/ipykernel/resources
[D 11:37:44.024 NotebookApp] Native kernel (python3) available from /Users/tkb/miniconda3/lib/python3.4/site-packages/ipykernel/resources
[D 11:37:44.026 NotebookApp] 304 GET /api/kernelspecs (::1) 2.61ms
[D 11:37:44.054 NotebookApp] 200 GET /api/contents/Untitled9.ipynb?type=notebook&_=1445107063680 (::1) 3.10ms
[D 11:39:07.219 NotebookApp] Native kernel (python3) available from /Users/tkb/miniconda3/lib/python3.4/site-packages/ipykernel/resources
[D 11:39:07.220 NotebookApp] Starting kernel: ['/Users/tkb/miniconda3/bin/python', '-m', 'ipykernel', '-f', '/Users/tkb/Library/Jupyter/runtime/kernel-8d08ac9f-1a83-4c3c-9d4b-cdb56bb8de1b.json']
[D 11:39:07.226 NotebookApp] Connecting to: tcp://127.0.0.1:54550
[I 11:39:07.227 NotebookApp] Kernel started: 8d08ac9f-1a83-4c3c-9d4b-cdb56bb8de1b
[D 11:39:07.227 NotebookApp] Kernel args: {'cwd': '/Users/tkb', 'kernel_name': 'python3'}
[D 11:39:07.229 NotebookApp] 201 POST /api/sessions (::1) 83009.22ms
[D 11:39:07.233 NotebookApp] 200 GET /api/contents/Untitled9.ipynb/checkpoints?_=1445107063681 (::1) 2.13ms
[D 11:39:07.236 NotebookApp] 200 GET /nbextensions/widgets/notebook/js/extension.js?v=20151017113736 (::1) 2.02ms
[D 11:39:07.239 NotebookApp] 304 GET /static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js?rev=2.5.3 (::1) 1.98ms
[D 11:39:07.241 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?rev=2.5.3 (::1) 1.47ms
[D 11:39:07.246 NotebookApp] Initializing websocket connection /api/kernels/8d08ac9f-1a83-4c3c-9d4b-cdb56bb8de1b/channels
[D 11:39:07.250 NotebookApp] Requesting kernel info from 8d08ac9f-1a83-4c3c-9d4b-cdb56bb8de1b
[D 11:39:07.250 NotebookApp] Connecting to: tcp://127.0.0.1:54547
[D 11:39:07.271 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/init.js?v=20151017113736 (::1) 1.93ms
[D 11:39:07.278 NotebookApp] 200 GET /nbextensions/widgets/notebook/js/widgetarea.js?v=20151017113736 (::1) 1.75ms
[D 11:39:07.289 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/manager.js?v=20151017113736 (::1) 2.11ms
[D 11:39:07.294 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_box.js?v=20151017113736 (::1) 2.71ms
[D 11:39:07.298 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget.js?v=20151017113736 (::1) 2.13ms
[D 11:39:07.302 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_image.js?v=20151017113736 (::1) 2.68ms
[D 11:39:07.305 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_bool.js?v=20151017113736 (::1) 2.61ms
[D 11:39:07.308 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_link.js?v=20151017113736 (::1) 2.53ms
[D 11:39:07.316 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_button.js?v=20151017113736 (::1) 7.19ms
[D 11:39:07.319 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_float.js?v=20151017113736 (::1) 1.95ms
[D 11:39:07.323 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_output.js?v=20151017113736 (::1) 2.28ms
[D 11:39:07.328 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_int.js?v=20151017113736 (::1) 3.74ms
[D 11:39:07.332 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_selection.js?v=20151017113736 (::1) 2.09ms
[D 11:39:07.335 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_selectioncontainer.js?v=20151017113736 (::1) 2.64ms
[D 11:39:07.339 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_string.js?v=20151017113736 (::1) 2.78ms
[D 11:39:07.344 NotebookApp] 200 GET /nbextensions/widgets/widgets/js/widget_controller.js?v=20151017113736 (::1) 1.91ms
[D 11:39:07.347 NotebookApp] 200 GET /static/components/backbone/backbone-min.js?v=20151017113736 (::1) 1.91ms
[W 11:39:17.257 NotebookApp] Timeout waiting for kernel_info reply from 8d08ac9f-1a83-4c3c-9d4b-cdb56bb8de1b
[D 11:39:17.259 NotebookApp] Opening websocket /api/kernels/8d08ac9f-1a83-4c3c-9d4b-cdb56bb8de1b/channels
[D 11:39:17.259 NotebookApp] Connecting to: tcp://127.0.0.1:54547
[D 11:39:17.260 NotebookApp] Connecting to: tcp://127.0.0.1:54548
[D 11:39:17.261 NotebookApp] Connecting to: tcp://127.0.0.1:54549
[D 11:39:44.335 NotebookApp] 200 GET /api/contents/Untitled9.ipynb?content=0&_=1445107063682 (::1) 1.99ms
[I 11:39:44.342 NotebookApp] Saving file at /Untitled9.ipynb
[D 11:39:44.342 NotebookApp] Saving /Users/tkb/Untitled9.ipynb
[D 11:39:44.355 NotebookApp] 200 PUT /api/contents/Untitled9.ipynb (::1) 14.15ms
[D 11:40:24.403 NotebookApp] Received kernel info: {'protocol_version': '5.0', 'implementation': 'ipython', 'language_info': {'nbconvert_exporter': 'python', 'file_extension': '.py', 'version': '3.4.3', 'name': 'python', 'pygments_lexer': 'ipython3', 'codemirror_mode': {'name': 'ipython', 'version': 3}, 'mimetype': 'text/x-python'}, 'help_links': [{'text': 'Python', 'url': 'http://docs.python.org/3.4'}, {'text': 'IPython', 'url': 'http://ipython.org/documentation.html'}, {'text': 'NumPy', 'url': 'http://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy', 'url': 'http://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib', 'url': 'http://matplotlib.org/contents.html'}, {'text': 'SymPy', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas', 'url': 'http://pandas.pydata.org/pandas-docs/stable/'}], 'banner': 'Python 3.4.3 |Continuum Analytics, Inc.| (default, Mar  6 2015, 12:07:41) \nType "copyright", "credits" or "license" for more information.\n\nIPython 4.0.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython\'s features.\n%quickref -> Quick reference.\nhelp      -> Python\'s own help system.\nobject?   -> Details about \'object\', use \'object??\' for extra details.\n%guiref   -> A brief reference about the graphical user interface.\n', 'implementation_version': '4.0.0'}
[D 11:41:44.233 NotebookApp] 200 GET /api/contents/Untitled9.ipynb?content=0&_=1445107063683 (::1) 1.29ms
[I 11:41:44.242 NotebookApp] Saving file at /Untitled9.ipynb
[D 11:41:44.242 NotebookApp] Saving /Users/tkb/Untitled9.ipynb
[D 11:41:44.257 NotebookApp] 200 PUT /api/contents/Untitled9.ipynb (::1) 16.01ms
^C[I 11:42:18.183 NotebookApp] interrupted
Serving notebooks from local directory: /Users/tkb
1 active kernels 
The IPython Notebook is running at: http://localhost:9999/
Shutdown this notebook server (y/[n])? ^C[C 11:42:19.726 NotebookApp] received signal 2, stopping
[I 11:42:19.728 NotebookApp] Shutting down kernels
[I 11:42:20.142 NotebookApp] Kernel shutdown: 8d08ac9f-1a83-4c3c-9d4b-cdb56bb8de1b
Reply all
Reply to author
Forward
0 new messages