-
Notifications
You must be signed in to change notification settings - Fork 855
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
terraform epoll_wait high cpu utilization #3276
Comments
Try 17134 and see how that fares. But ref #3191 which reportedly is okay in 17134 through 17661 but not okay in 17666 - 17???. |
ok, I will attempt to get an environment setup on the insider release of windows to test. |
This one is awkward because WSL improved from FCU 16299 and April Update 17134, but #3191 is still under investigation. If it were me I would try 17134 stable first not insiders. Or try both if you are feeling highly motivated. Your problem could be fixed in 17134 but broken on the most recent insiders (17682 as of this writing). Or it could be an unrelated problem and spin in both. [Or, it could even be, albeit less likely, an unrelated problem and work fine in both 17134 and 17682, but not 16299.] |
what are the next steps in debugging this issue so that it can be resolved? debug logs? straces? |
@therealkenc - indeed, that is quite an oversight on my part; likely unrelated issues. |
@jgrammen-agilitypr I downloaded a terraform binary and tried the example and did not see any CPU usage while it was prompting for the first value. Does this work for you as well? |
@Brian-Perkins the example you used, does not get far enough into the terraform process to actually cause problems. you need something closer to the example posted at the beginning of this thread. I am linking to a gist which contains a more complete project example: All of thoes files go in a folder, in my case named "test". inside the folder you run 'terraform init', to setup the aws provider. The example just creates an amazon ec2 nano instance, running ubuntu 16.04 xenial. |
Unfortunately it looks like that sample actually tries to connect to AWS as I am getting an error that the security token is invalid. So a repro from my side is seeming less likely. @jgrammen-agilitypr can you update your strace output with a "-f" as the original doesn't appear to contain the problematic loop. For starters I am mostly interested in what file type is causing the epoll_wait to always be ready so that I can at least narrow down the problem-space. |
Doing this need-repro so it doesn't float indefinitely. Needs something self-contained (which I think is possible with terraform). |
I apologize for the delay, I must have missed the notification of your comment. the command run was
|
You can reproduce it with this:
main.tf
This will create a file called foo.txt with the contents "foo". The first time you will need to run If the file exists remove it, run I'm on Windows 1803 (OS Build 17134.112), in WSL, with Terraform v0.11.7, I get 25% CPU utilisation in kernel mode - I have 2 cores, with hyperthreading so 4 processors, the utilisation is balanced across all 4 processors - in effect at any point in time one CPU is 100% utilisation but there's no affinity to one CPU so over time it is spread across all CPUs and looks like 1/N utilisation. With more complex projects I get 100% CPU utilisation (all cores pegged at 100% in kernel). I suspect this is because with more terraform plugins there are more processes and they are all spinning creating more load on more cores. |
Much better, thanks @berney. You didn't say what version of Windows 10 you are on. If it still spins on 17704 (which you'll inevitably be asked to try) then that is a good repro. |
Sorry, I updated my comment above to state I'm on Windows 1803 (OS Build 17134.112) and using Terraform v0.11.7 in WSL. |
I have tested @berney 's reproduction steps in insiders build 17704 terraform -v
windows version
WSL
|
Thanks, much appreciated. That's kind of what I figured, because this issue didn't seem to be dupe #3191 from the get-go. The devs will have to take a look from here. Pro-tip: In general you can increase the chances of that happening by providing CLI repro steps from clean install, the first step often being either |
Ok, thanks for the pro tip. If dev's need more information or debug logs etc, ask away and I will do my best to provide what I can. |
This is an issue with pipes and the EPOLLET epoll event flag, where the EPOLLET part is not being respected so the epoll_wait always returns immediately. |
Fixed in build 17723 |
This bug-tracker is monitored by developers and other technical types. We like detail! So please use this form and tell us, concisely but precisely, what's up. Please fill out ALL THE FIELDS!
If you have a feature request, please post to the UserVoice.
If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.
Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues. Instead, send dumps/traces to [email protected], referencing the GitHub bug number. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".
ver
at a Windows Command Prompt)Microsoft Windows [Version 10.0.16299.431]
I am using terraform to start virtual infrastructure in aws. while terraform is waiting for input, it experiences very high cpu utilization. this appears to be related to epoll_wait.
the WSL version of terraform experiences this high cpu, where as the windows version does not.
I am quite aware that the developers are not necessarily familiar with terraform, but this issue no longer appears to be a terraform but instead an issue with how WSL handles the epoll_wait calls.
screen shots
![terraform-high-cpu-2](https://user-images.githubusercontent.com/22965146/40918722-262f7d6a-67d5-11e8-8c32-d2119d64a851.png)
![terraform-windows](https://user-images.githubusercontent.com/22965146/40918723-26433ad0-67d5-11e8-852c-f0a8813252fa.png)
WSL version show very high cpu while waiting for use input
windows version of terraform showing non high cpu
terraform -v
WSL / ubuntu for windows (on windows 10 build 1709)
terraform mainfest
While waiting for user input the application should not be using very high cpu
some_command
is failing, then runstrace -o some_command.strace -f some_command some_args
, and link the contents ofsome_command.strace
in a gist here)straces gist:
https://gist.github.com/jgrammen-agilitypr/47bf7baa6d81b1bbccd6e9189c047aff
See our contributing instructions for assistance.
The text was updated successfully, but these errors were encountered: