I'm having a weird problem with Jupyter notebook running inside a WSL2 instance. Every time I start a new notebook, my first connection to localhost:8888
(or localhost:XXXX
for any other port number) takes a LONG time to connect, like 5-10 minutes. Once one connection to that port has been made, however, all subsequent connections happen at a normal speed. As far as I can tell the delay is not specifically happening within the Jupyter server, as the server output doesn't show any GET
requests during the waiting period:
> jupyter notebook .
[I 08:29:21.282 NotebookApp] Authentication of /metrics is OFF, since other authentication is disabled.
[W 08:29:21.729 NotebookApp] All authentication is disabled. Anyone who can connect to this server will be able to run code.
[I 08:29:21.732 NotebookApp] Serving notebooks from local directory: /home/peter/jade_poplar/code/python
[I 08:29:21.732 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 08:29:21.732 NotebookApp] http://localhost:8888/
[I 08:29:21.732 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
...
5-10 MINUTES ELAPSE
...
[I 08:38:12.718 NotebookApp] 302 GET / (127.0.0.1) 2.110000ms
However, the issue does appear to be limited only to Jupyter: if I just listen on the port with nc -l 8888
and then point my browser to localhost:8888
the GET
request shows up immediately.
I have tried random fixes to other problems that I found on SE, eg. this one, but to no avail. Any advice, or even a suggestion as to where to start looking, would be greatly appreciated! This is driving me bonkers, although I am getting a lot of chess in while I wait for my notebooks to load :D