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

High CPU and Slow Responses #1946

Open
rifelpet opened this issue Feb 11, 2025 · 0 comments
Open

High CPU and Slow Responses #1946

rifelpet opened this issue Feb 11, 2025 · 0 comments
Labels
performance Gotta go fast

Comments

@rifelpet
Copy link

Language Server Version

0.36.4+Homebrew

Terraform Version

Terraform v1.7.0 on darwin_arm64, via tfenv

Client Version

VSCode 1.97.1 w/ hashicorp.terraform 2.34.3

Behavior

After a while of having my terraform directories open in VSCode I'll notice that the terraform-ls process is consistently using >600% CPU.

When this happens and I save a .tf file in VSCode, the Getting code actions from 'HashiCorp Terraform' notification spins for ~20 seconds and until another Saving 'modules_generated.tf': Running Code Actions and Formatters... notification pops up. Both remain spinning for another 7 or 8 minutes. Even after the notifications have disappeared, the file still isn't saved so running terraform commands in my terminal wont pick up the changes I've made.

Image

Steps to Reproduce

Unfortunately I don't have specific instructions. It happens after I've had various VSCode workspaces open for hours.

Most of my VSCode workspaces contain a single terraform root module though they are subdirectories of a larger monorepo with thousands of terraform root and shared modules.

Here is a screenshot from Activity Monitor showing the sustained CPU usage:
Image

In addition to the logs gist below, I also uploaded base64-encoded profile dumps:

Terraform Configuration

Project Structure

Gist

https://gist.github.com/rifelpet/a20827b2345aac0fe06ab0a7fabac2e4

References

No response

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@rifelpet rifelpet added the performance Gotta go fast label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Gotta go fast
Projects
None yet
Development

No branches or pull requests

1 participant