Skip to content
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

Preloading kernels / enabling a pool of kernels #30

Open
astrojuanlu opened this issue Nov 28, 2018 · 8 comments
Open

Preloading kernels / enabling a pool of kernels #30

astrojuanlu opened this issue Nov 28, 2018 · 8 comments

Comments

@astrojuanlu
Copy link
Contributor

I am experimenting with a moderately complex notebook (~10 widgets, among them an ipyleaflet map) and I have seen that, from first GET request to the end of the load, it takes about 1 minute, and sometimes it gives timeouts when loading the JavaScript modules. I wonder if there would be some way to "preload" a pool of kernels to help accelerate page show times. Not sure if this is similar to #5.

@SylvainCorlay
Copy link
Member

A visual indication that things are loading would be a first step.

@astrojuanlu
Copy link
Contributor Author

True. At the moment I'm planning to simulate that by embedding the voila HTML in an iframe, and putting some loading indication outside.

@maartenbreddels
Copy link
Member

I see a few options here:

  • Have a different kernel_manager that will keep some preheated kernels (for instance spinning up N kernels, and doing importing of some modules). This will already speed up execution time in many cases. I think that can live outside of voila, maybe go in jupyter_server.
  • Have a pool of already executed kernels ready, this seems like a use case only useful for voila, and requires matching time of executing to the last modification date of the notebook/file to not get old results. I could see this living in voila.
  • Same as previous point, but only have 1 executed kernel per notebook, but fork it each time a request is made (see Question / Idea #5).
  • 'Async' rendering of the html and showing the notebook output. This kind of moves away from using nbconvert for offlifting the rendering of notebooks, since it requires that there are '2' parts of a template. The initial rendering and the rendering of the 'cells' or whole body.

On the last point, I also want to bring up a use cases that we (me @SylvainCorlay and @pbugnion) discussed yesterday. If you want to render voila in a Jupyter Lab panel (is that the right word?) you only want to render the 'body' part of the HTML.

Also, another use case I have in mind is to have a template served directly, no cell output will be rendered, but the template itself takes care of rendering the widgets at specific locations.

Some food for thought.

@SylvainCorlay SylvainCorlay changed the title Feature request: way to preload/have a pool of kernels Preloading kernels / enabling a pool of kernels Nov 29, 2018
@parente
Copy link

parente commented Nov 30, 2018

@maartenbreddels
Copy link
Member

Thanks, that is good to know!

@marscher
Copy link

Since almost three years passed since the last update of this issue I kindly ask if there is any progress on this. I'd be interested in forking a "preloaded" ipykernel. This kernel would just heat up the imports, which take some time in my case.

@maartenbreddels
Copy link
Member

If you follow the last reference (#820) you see it links to https://github.com/voila-dashboards/hotpot_km (voila-dashboards/hotpot_km#8 might help settings things up)

@marscher
Copy link

Thanks for the quick reply. I should have red this more intensively :) Will check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants