-
Notifications
You must be signed in to change notification settings - Fork 449
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
Improvements to EC2 metadata handling #995
Conversation
Signed-off-by: Tim Smith <tsmith@chef.io>
Not sure what the goal was here. The sort always works. Just roll with it Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
We were still missing a few Signed-off-by: Tim Smith <tsmith@chef.io>
We fetched all available versions 3 times and then we sorted and found the best results 3 times. That seems a bit silly. Signed-off-by: Tim Smith <tsmith@chef.io>
@ViktorSchlaffer This should resolve #994 by only creating a single net/http object and using the appropriate methods that allow connection reuse within net/http. I'm not able to verify the change using AWS however since they only support http 1.0 w/o keepalives. Any chance you can pull this branch down somewhere and let me know if you see a reduction in connections? |
Signed-off-by: Tim Smith <tsmith@chef.io>
c3b72b4
to
79f0626
Compare
@tas50 I've verified you changes in our Openstack environment, and now the ec2 plugin uses only one tcp connection for the http requests. I have not been able to deploy this on all of our instances, as that decision is not in my hands, but from a functional point of view, this is what I was looking for, so I expect, that it will resolve the connection pool starvation issue. |
There's a few changes here so far.
Better logging when we reject a version that Amazon says they support
Drop our timeouts to a more reasonable time. These APIs are crazy fast there's no need to wait 30 seconds
Only setup the http client object once and use methods that allow connection reuse
Don't parse the best API version 3 times
Add all current EC2 metadata versions