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

Extension still causes high CPU load #1355

Closed
michael-delarue-axomic opened this issue Mar 10, 2023 · 8 comments
Closed

Extension still causes high CPU load #1355

michael-delarue-axomic opened this issue Mar 10, 2023 · 8 comments
Labels
bug Something isn't working performance Gotta go fast

Comments

@michael-delarue-axomic
Copy link

Versions

Extension

v2.25.4

VS Code

Version: 1.76.1
Commit: 5e805b79fcb6ba4c2d23712967df89a089da575b
Date: 2023-03-08T16:31:31.010Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Linux x64 5.15.0-60-generic
Sandboxed: No

Operating System

$ uname -a
Linux Pete 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Linux Mint 21 Vanessa \n \l

Terraform Version

$ terraform --version
Terraform v1.3.8
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v4.58.0

Your version of Terraform is out of date! The latest version
is 1.4.0. You can update by downloading from https://www.terraform.io/downloads.html

Steps To Reproduce

  1. Enter VSCode in a big repo with many Terraform modules
  2. have something else heavy in CPU usage happen
  3. See computer near lock up

Include any relevant Terraform configuration or project structure:

You can use tree to output ASCII-based hierarchy of your project.

If applicable, add screenshots to help explain your problem.
-->

Expected Behavior

everything should be happy and stable. Meting apps should run fine

Actual Behavior

if a meeting program or similar which has high IO or high memory usage happens the system can slow down considerably

Additional context

@michael-delarue-axomic michael-delarue-axomic added the bug Something isn't working label Mar 10, 2023
@michael-delarue-axomic
Copy link
Author

@shubhamsre
Copy link

After upgrading vscode to 1.77.X version, mac went into a state of non-responsiveness.

image

Then, I downgraded the vscode to 1.63.X, which has resolved the issue for me.
image

The difference is the parent process is code-helper plugin. However when I downgraded it to Version: 1.63.2 (Universal), the parent process is Electron.

image

@xiehan xiehan added the performance Gotta go fast label Apr 21, 2023
@radeksimko
Copy link
Member

We plan to make some changes as part of hashicorp/terraform-ls#1056 to help us understand situations like this (performance). While CPU/memory profiles can already be collected, these would not be as useful without context (such as some understanding of the workspace - no of files, folders, sizes of files etc.).

In the meantime, the only suggestion I can make is to avoid opening large/deep workspaces with lots of folders, esp. monorepos - i.e. open the one or few individual folders that you actually need to edit at any given time. This may not be most convenient, but should help avoid most performance issues for now.

Thank you for your patience and understanding.

@rmccarthy-ellevation
Copy link

Screenshot 2023-06-13 at 11 38 22 AM Running into the same/similar issue. Any update on when the fix is going to be pushed out?

@jgspratt
Copy link

Possible duplicate: #1328

Updated to the pre-release version and it solved the CPU issue but threw this in the output.

Is there a way to just disable this "server" interaction? All I want is syntax highlighting and autocomplete.

Launching language server: /Users/jgspratt/.vscode/extensions/hashicorp.terraform-2.27.2023062109-darwin-x64/bin/terraform-ls serve
Starting client
Client: Stopped --> Starting
Client: Starting --> Stopped
[Error - 2:31:33 PM] terraform client: couldn't create connection to server.
Error: spawn Unknown system error -86
	at ChildProcess.spawn (node:internal/child_process:441:11)
	at Object.spawn (node:child_process:752:9)
	at /Users/jgspratt/.vscode/extensions/hashicorp.terraform-2.27.2023062109-darwin-x64/out/extension.js:2:735385
	at async C.createConnection (/Users/jgspratt/.vscode/extensions/hashicorp.terraform-2.27.2023062109-darwin-x64/out/extension.js:2:571951)
	at async C.start (/Users/jgspratt/.vscode/extensions/hashicorp.terraform-2.27.2023062109-darwin-x64/out/extension.js:2:562466)
	at async e.activate (/Users/jgspratt/.vscode/extensions/hashicorp.terraform-2.27.2023062109-darwin-x64/out/extension.js:2:1088757)
	at async w.n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:6194)
	at async w.m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:6157)
	at async w.l (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:5614)

@jpogran
Copy link
Contributor

jpogran commented Aug 18, 2023

We know this has been a frustrating experience and appreciate your understanding while we gathered feedback and examples to diagnose this issue. We've created #1557 as a central place to see updates on what we are doing to address performance issues in terraform-ls in both the short and long term and pinned it to the repo. We'll be adding more detail there as we implement fixes. As we work on this we'll be recording the content and then closing the individual issues so that everyone has one place to look at instead of searching for individual tickets for updates.

@jpogran
Copy link
Contributor

jpogran commented Sep 13, 2023

We've released 2.27.2 which contains two fixes (hashicorp/terraform-ls#1369, hashicorp/terraform-ls#1372) in our continuing efforts to address this issue.

With the fix, we should be back to terraform-ls v0.29.2 levels of CPU usage while maintaining the memory improvements of v0.29.3.

If you have the time, please give it a try and let us know how it works for you. Please open a new issue rather than replying here, as this issue has gotten so many replies with different experiences it is hard to process.

I am going to close this as we're using #1557 as a central tracking issue, so subscribe to that to see continued updates.

@jpogran jpogran closed this as completed Sep 13, 2023
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working performance Gotta go fast
Projects
None yet
Development

No branches or pull requests

7 participants