Skip to content

Listing SSH targets is slow with big config/many hosts #2857

Open

Description

@iwanb

Version: 1.45.0-insider
Commit: 0778354f3a6a2c21b7f738a5e6b02e2f1c765e73
Date: 2020-04-27T05:34:13.940Z
Electron: 7.2.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.6.6-200.fc31.x86_64

  • VSCode Version: 1.45-insider
  • Local OS Version: Fedora 31
  • Remote OS Version: N/A
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:

  1. Create large (I have 36K lines and 7K hosts) ~/.ssh/config file with hosts

  2. Open SSH targets tab of vscode

This is slow and takes a lot of CPU, the console outputs this:
WARN UNRESPONSIVE extension host, 'ms-vscode-remote.remote-ssh' took 93% of 5265.002ms, saved PROFILE here: '/tmp/exthost-7388f2.cpuprofile' (the profile contains internal data so I'd rather not upload it, but it should be easy to reproduce with dummy hosts).

Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A

Kind of related, it would be good to have a filtering mechanism for when you have many hosts.

Activity

  1. ian-h-chamberlain commented on Apr 28, 2020

    @ian-h-chamberlain

    I noticed the same issue, it renders the SSH targets tab pretty much unusable in my case, unfortunately I cannot upload a profile for the same reason. In my case I have a 33-line config with ~10 hosts which Includes another 93K line file with ~12K hosts in it.

    One thing I noticed however was that downgrading to version 0.49.0 of the extension allows me to actually use the SSH hosts tab again, but I can reliably reproduce with newer version of the extension Remote - SSH extension and no other extensions enabled.

  2. RamyElkest commented on Nov 2, 2020

    @RamyElkest

    Same issue here, almost the same amount ~7k hosts and the extension consistently fails to start (unresponsive).

    As a workaround we extracted a subset of that hosts into a separate config which we set with "remote.SSH.configFile".

  3. added
    bugIssue identified by VS Code Team member as probable bug
    on Nov 6, 2020
  4. added this to the Backlog milestone on Nov 6, 2020
  5. roblourens commented on Nov 6, 2020

    @roblourens
    Member

    Interesting, we probably try to parse it too many times

  6. hmc-cs-mdrissi commented on Mar 16, 2024

    @hmc-cs-mdrissi

    This is still an issue and one I just hit. The extension is entirely unresponsive for any simple command. I have ~150k line long sshconfig (large number of company machines) that normal ssh command works fine, but this extension struggles with.

  7. LunarLanding commented on Mar 21, 2025

    @LunarLanding

    By filtering down the config to 4 hosts, I hoped I would fix this drag.
    However, the extension still takes multiple seconds to parse it.
    Btw, the UI component is called "Remote - Explorer".
    Then I uninstalled the "Remote - Tunnels" extension. It cut down the 4 seconds to less than 1.
    In fact, I could use my original config file and it still takes below 1s to load.
    I am not using Tunnels so this is acceptable to me.

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

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugsshIssue in vscode-remote SSH

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions