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

After 0.12.0 upgrade teraform spawns 1000+ process and uses 7GB of RAM #21584

Closed
tomaxsas opened this issue Jun 4, 2019 · 11 comments · Fixed by #22553
Closed

After 0.12.0 upgrade teraform spawns 1000+ process and uses 7GB of RAM #21584

tomaxsas opened this issue Jun 4, 2019 · 11 comments · Fixed by #22553

Comments

@tomaxsas
Copy link

tomaxsas commented Jun 4, 2019

Terraform Version

$ terraform.exe -v
Terraform v0.12.0

Actual Behavior

After upgrading to new terrafrom and running apply to config 16 VM's terrafomr spawns 1000+ process and use 7GB of RAM
image

Additional Context

Win 10 OS

@jbardin
Copy link
Member

jbardin commented Jun 4, 2019

Hi @tomaxsas,

Thanks for letting us know!
Can you provide any more information about your system? Is there an unusually large number of providers or provisioners in your configuration? Are these processes left running after the main process has exited, or do they clean up afterwards? Can you inspect the arguments of these processes to determine what the processes are for?

Thanks!

@tomaxsas
Copy link
Author

tomaxsas commented Jun 5, 2019

one provider, it's, vSphere, and latest version (1.11.0). Only 3 provisioners per VM. All processes are exited after execution
And here is command line args
image

@tomaxsas
Copy link
Author

tomaxsas commented Jun 5, 2019

0.12.1 did not fixed problem

@jbardin jbardin added the bug label Jun 5, 2019
@tomaxsas
Copy link
Author

so turns out terraform creates process for every provisioner which it founds in main.tf even if i target only one module out of many

@apparentlymart
Copy link
Contributor

Thanks for that additional context, @tomaxsas.

I suspect this is happening because Terraform must launch a provisioner to validate configurations for it. However, because that validation happens before the provisioner has been fully configured in principle we should be able to share a single process per provisioner type for the entire configuration, and only launch the individual processes per configuration block during the apply phase. We'll investigate that for a future release.

@apparentlymart
Copy link
Contributor

In #21827 we can see a variant of this problem on a Unix-like OS. Because of the fork/exec model I suspect it takes a lot more provisioners to hit the limit there, but it's still excessive to perform validation of each block in a separate process.

@tomaxsas
Copy link
Author

Are there ETA on this? As it's really a huge bug for users with few provisioners...

@stahs
Copy link

stahs commented Jun 28, 2019

@tomaxsas agreed. This is completely blocking us from upgrading to 0.12 and I imagine it's a big problem for any deployments with an appreciable number of provisioners.

@Gerr-Alt
Copy link

Gerr-Alt commented Aug 8, 2019

Same problem. Can you please give some ETA? That is the huge problem for us.

@tomaxsas
Copy link
Author

Thanks, now resource updates is 5-10 times faster and ram only 60-130MB

@ghost
Copy link

ghost commented Sep 22, 2019

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.

@ghost ghost locked and limited conversation to collaborators Sep 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants