microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.65k stars 285 forks source link

Connecting to a container in a remote server is very slow #10257

Closed devymex closed 1 month ago

devymex commented 1 month ago

Type: Performance Issue

Connect a container on remote server

Extension version: 0.384.0 VS Code version: Code 1.93.0 (Universal) (4849ca9bdf9666755eb463db297b69e5385090e3, 2024-09-04T13:02:38.431Z) OS version: Darwin arm64 23.6.0 Modes: Remote OS version: Linux x64 5.4.119-19.0009.28

System Info |Item|Value| |---|---| |CPUs|Apple M2 (8 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|2, 2, 2| |Memory (System)|24.00GB (0.36GB free)| |Process Argv|--crash-reporter-id 66093be1-d7a2-4f38-bc3e-a34027ea719c| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|Container yumeng:dev (yumeng) @ h39| |OS|Linux x64 5.4.119-19.0009.28| |CPUs|Intel(R) Xeon(R) Platinum 8480+ (200 x 0)| |Memory (System)|1877.99GB (1709.27GB free)| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 8 319 43476 code main 0 123 43480 gpu-process 0 49 43482 utility-network-service 1 147 43489 shared-process 0 0 78586 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 1 786 77731 window [5] (Dev_Container.log — llava-glint [Container yumeng:dev (yumeng) @ h39]) 0 147 78214 extensionHost [5] 0 74 78226 fileWatcher [5] Remote: Container yumeng:dev (yumeng) @ h39 CPU % Mem MB PID Process 0 0 181788 remote agent 0 0 181907 ptyHost 0 0 194652 /usr/bin/bash --init-file /root/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh 0 0 194780 /usr/bin/bash --init-file /root/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh ```
Workspace Info ``` | Remote: Container yumeng:dev (yumeng) @ h39| Folder (llava-glint): 350 files| File types: py(80) sh(41) txt(22) pyc(19) jsonl(17) json(15) log(14) | md(13) yaml(9) patch(6) | Conf files: dockerfile(1) devcontainer.json(1) launch.json(1) | settings.json(1) | Launch Configs: debugpy(7); ```
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 bdiig495:31013172 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 2f103344:31071589 impr_priority:31102340 nativerepl1:31134654 refactort:31108082 pythonrstrctxt:31112756 flightc:31134773 wkspc-onlycs-t:31132770 wkspc-ranged-c:31125598 fje88620:31121564 ```

Dev_Container.log

chrmarti commented 1 month ago

Something in your shell startup scripts takes a long time:

[7280 ms] Start: Run in Container: /bin/bash -lic echo -n 6a8bdd15-7493-4674-81c1-6adce40a01c2; cat /proc/self/environ; echo -n 6a8bdd15-7493-4674-81c1-6adce40a01c2
[17283 ms] userEnvProbe is taking longer than 10 seconds. Avoid waiting for user input in your shell's startup scripts. Continuing.

Some other commands also take quite long, could you share your devcontainer.json (and Dockerfile if any)?

devymex commented 1 month ago

Something in your shell startup scripts takes a long time:

[7280 ms] Start: Run in Container: /bin/bash -lic echo -n 6a8bdd15-7493-4674-81c1-6adce40a01c2; cat /proc/self/environ; echo -n 6a8bdd15-7493-4674-81c1-6adce40a01c2
[17283 ms] userEnvProbe is taking longer than 10 seconds. Avoid waiting for user input in your shell's startup scripts. Continuing.

Some other commands also take quite long, could you share your devcontainer.json (and Dockerfile if any)?

Sure, all things in the .devcontainer are auto generated by VSC.

devcontainer.tar.gz

However, even if I delete this directory, the connection issue still persists.

From host, use docker exec -it yumeng /bin/bash to enter the container is very fast.

Thanks for help!

chrmarti commented 1 month ago

Maybe some of the Python environment activation added to .bashrc and .zshrc by postCreateCommand.sh adds to the time used? Not sure why docker exec -it doesn't see that.

vs-code-engineering[bot] commented 1 month ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!