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

Remote containers: connecting to docker container on remote docker daemon very slow #3303

Closed
Genius1237 opened this issue Jul 1, 2020 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote)

Comments

@Genius1237
Copy link

  • VSCode Version: 1.46.1
  • Local OS Version: Ubuntu 20.04
  • Remote OS Version: Ubuntu 18.04
  • Remote Extension/Connection Type:Docker

Steps to Reproduce:
I am connecting to a docker container on a remote host via the remote-containers extension

  1. This is done by setting docker.host to ssh://remote_host after which the extension will be able to communicate with the docker daemon on the remote host
  2. After setting this, I use the option to attach to an existing container. This takes a while, as much as 30 sec to 1 minute. It finds containers running on the existing host and then lists them
  3. On selecting the container, a new window is launched and it tries to establish a connection. I can see in the log that it is performing the steps of downloading and installing the server and running node
  4. This step takes around 1-2 minutes and then times out. I get an error saying time limit reached

If i follow a slightly different sequence of steps, I am able to get this running much faster

  1. Bind the remote docker daemon to a local port using ssh. I run ssh -L localhost:6066:/var/run/docker.sock remote_machine
  2. Set docker.host in vscode to tcp://localhost:6066
  3. Now try attaching to an existing container. This happens almost instantaneously and I have a folder opened in the remote container within a minute

Why is the second version so much faster? I guess that the sequence of steps that VS code does internally is pretty similar to binding the remote docker daemon locally, so why is it much slower?

Does this issue occur when you try this locally?: NA
Does this issue occur when you try this locally and all extensions are disabled?: NA

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jul 1, 2020
@chrmarti chrmarti added the upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote) label Jul 3, 2020
@chrmarti
Copy link
Contributor

chrmarti commented Jul 3, 2020

We rely on the Docker CLI for doing the connection. Marking as upstream.

@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Jul 3, 2020
@chrmarti chrmarti self-assigned this Jul 3, 2020
@chrmarti
Copy link
Contributor

chrmarti commented Nov 5, 2020

We recently discovered that SSH connections can be reused to improve the performance: #3938

The forwarded TCP port might still be faster (you'd have to measure with your setup), but the SSH config might sometimes offer an easier to use improvement.

Closing.

@chrmarti chrmarti closed this as completed Nov 5, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote)
Projects
None yet
Development

No branches or pull requests

2 participants