-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jupyter Server startup really slow when panel is installed #4271
Comments
2i2c-org/infrastructure#2047 has more of the investigation. |
Panel and Xarray-Leaflet are heavy enough imports that without .pyc files, they sometimes together take as much as 15s to import?! This causes jupyterhub to fail startup in some cases. The longer term fix is in panel and xarray-leaflet ( see holoviz/panel#4271, xarray-contrib/xarray_leaflet#79). In the meantime, leaving the .pyc files in place doesn't increase the image size by much, but makes startup definitely much faster! Ref 2i2c-org/infrastructure#2047
I opened jupyter-server/jupyter_server#1171 to surface this performance information more readily |
Thanks for posting @yuvipanda! Seems like avoiding the IPython import would make a huge difference here. Happy to find a way around that and cut a 0.14.3 release asap. |
In #4276 I've now split the code that runs as part of the server extension and the code that is executed inside a kernel which reduces the imports significantly. |
Wow amazing that was really quick thank you so much @philippjfr |
That's awesome, @philippjfr! LMK if / when you think the next release may be :) |
Looking at this right now, with panel 1.2, it still adds about 1.6s to jupyterhub server startup time, which is a couple orders of magnitude moree than some other packagse - for example, JupyterLab adds |
Thanks for letting me know. Sounds like a regression, I'll make sure to add some tests. |
ALL software version info
Description of expected behavior and the observed behavior
When starting a JupyterHub server with a container that has panel installed, sometimes the server process takes so long to startup that it times out and gets killed. Upon further investigation, this was partially due to importing the panel serverextension, which takes approximately 7s on some servers. This is due to importing some heavy packages at startup, including
IPython
itself (which takes about 2s)Complete, minimal, self-contained example code that reproduces the issue
Note that these numbers are without an existing
.pyc
cache files, which are generally removed when building containers. So on second run, I get these numberse:still kinda slow, but better.
Jupyter Server seems to import all extension modules even if they are not enabled, so there isn't a way to even temporarily disable the extension - only way to speed up the server startup is to uninstall panel completely.
A suggestion for tackling this would be to do the imports only when necessary, rather than at startup.
The text was updated successfully, but these errors were encountered: