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

Improving the latency of nb_conda_kernels #210

Closed
rvalieris opened this issue Oct 1, 2021 · 1 comment
Closed

Improving the latency of nb_conda_kernels #210

rvalieris opened this issue Oct 1, 2021 · 1 comment

Comments

@rvalieris
Copy link
Contributor

Hello, this is a problem I ran into on a multi-user jupyterhub installed on a cluster with a shared conda install, I have a working solution but I am creating this issue to explain the problem.

The problem:

nb_conda_kernels needs to constantly call conda info to query the env list, however, under some conditions, a call to conda info can take multiple seconds or even more than 1 minute to execute, while it runs the jupyter backend is unresponsive and this is specially noticeable on a terminal running inside jupyterlab, where each keystroke needs a roundtrip to the server.

How to reproduce:

  1. edit <conda-path>/bin/conda and add these lines to simulate the delay:
import time
time.sleep(10)
  1. run jupyterlab (with nb_conda_kernels) and open a terminal
  2. type 1 letter per second and watch for freezes, happens every 2 minutes or so.

Proposed solution:

execute conda info in the background and lazily update the cache, this approach minimizes the time blocked at the price of having the cache not be as fresh.

I have a working implementation of this solution, tested on linux. I don't know about macos and windows.

@mcg1969
Copy link
Collaborator

mcg1969 commented Mar 6, 2024

fixed by #211

@mcg1969 mcg1969 closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants