Skip to content

High CPU and Slow Responses #1946

Open
Open
@rifelpet

Description

@rifelpet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions