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

Feature Request: CPU Usage Limiting for Extension Host Process #233842

Open
technic960183 opened this issue Nov 14, 2024 · 1 comment
Open

Feature Request: CPU Usage Limiting for Extension Host Process #233842

technic960183 opened this issue Nov 14, 2024 · 1 comment
Assignees

Comments

@technic960183
Copy link

Description

Allow users to limit CPU usage for the Extension Host process, particularly during its initialization phase.

Background

In high-performance computing (HPC) environments, resources on login nodes are tightly restricted to maintain system stability for all users. During VS Code remote SSH startup, the Extension Host process often creates a significant CPU usage spike, specifically while initializing. For users on HPC login nodes, this spike can exceed system limits, resulting in the process of the Extension Host being automatically killed by the system. Once the initialization completes, the Extension Host runs with minimal CPU needs, so the issue is specific to the startup phase.

Details of Investigation

I have done extensive profiling to isolate this issue and verify that the spike occurs specifically in the initialization phase of the Extension Host process. This peak CPU demand is transient but high enough to exceed the limits in shared HPC environments. While this issue could also arise when there are many extensions installed, users in remote SSH environments often accept a slower initialization process in comparison to personal computers, as long as essential extensions can be loaded successfully.
The process that cause the issue: /work1/username/.vscode-server/cli/servers/Stable-e8653663e8840adaf45af01eab5c627a5af81807/server/node --dns-result-order=ipv4first /work1/username/.vscode-server/cli/servers/Stable-e8653663e8840adaf45af01eab5c627a5af81807/server/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false

Feature Request

I am requesting a feature that would allow users to set a CPU usage cap for the Extension Host process. A configuration or setting within VS Code to limit its CPU usage, even temporarily during initialization, would enable smoother integration in HPC environments.

While this may not be an issue for most VS Code users on personal computers, HPC users often encounter CPU usage limits rules that will kill the process. Introducing this feature could also benefit other restricted environments where resources are shared, making VS Code a more viable editor for scientific and high-performance computing users.

Thank you for considering this feature to improve VS Code’s compatibility with HPC systems.

@technic960183
Copy link
Author

I want to provide an update regarding this feature request.

Here is a related issue with the GitHub Copilot extension causing the Extension Host process to crash under specific conditions. The issue is detailed in #234355 .

While investigating, I initially thought that limiting CPU usage during initialization might resolve these crashes, especially in HPC environments where resource constraints are strict. However, this new issue suggests the crashes might not be directly related to CPU usage spikes alone.

Still, later we discovered that the desired functionality can already be achieved by external tools like CPULimit, which allow users to limit the CPU usage of the Extension Host process. This provides a potential workaround for managing CPU usage in resource-constrained environments.

Given this, I think that it will be great to leave it to your team to assess whether implementing this feature natively in VS Code would be beneficial or if relying on external tools is sufficient for such niche use cases.

Thank you for considering this request and for your continued efforts to improve VS Code.

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