-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add support for Kernelspec caching #908
Add support for Kernelspec caching #908
Conversation
Overall it looks good, I had a couple of question around some corner cases. Having said that, I believe this solves the overhead load on the server-side, but the contents of the kernelspec still go over the network, and maybe we could add support for ETAGS on a subsequent PR. |
Correct, this only addresses the redundant gathering of kernelspecs on the server. I wasn't aware of ETags, but that makes total sense - good idea. I'm assuming the browser would handle the |
So my last commit removed What do you think? |
…ns and posix paths.
cb5363c
to
1250a5f
Compare
Here's a gist to add code to create missing kernel_dir entries (rather than issue a warning) if we want that functionality: https://gist.github.com/kevin-bates/45ddbc94f49f5415bf2985394dbf6925 |
This pull request adds support for Kernel Specification caching. Since various applications tend to poll for kernelspecs, and EG needs to support multiple such applications, it makes sense to route kernelspec requests through a caching facility, which defers to the configured KernelSpecManager if the kernelspec is not found.
This implementation uses
watchdog
to monitor the directory hierarchies containing kernelspecs. If new kernelspecs are added that exist in non-monitored directories a cache miss will ensue - triggering the monitoring of the newly discovered directory.In current trials, this appears to have about a 70% performance increase in kernelspec retrievals.
For now, the cache is disabled by default. In EG 3.0 (or sooner?) we will enable caching to be on by default. Until then, it can be enabled via CLI option
--KernelSpecCache.cache_enabled=True
or envEG_KERNELSPEC_CACHE_ENABLED=True
.