-
Notifications
You must be signed in to change notification settings - Fork 6
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
Run resource executions in parallel #105
Conversation
$puts_mutex.synchronize { | ||
old_puts(*args) | ||
} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, Ruby starts printing partial lines
Instead of
Line 1
Line 2
Line 3
it prints
Line 1Line 2
Line 3
AWS actually limits us on the number of API calls that we can make in any given second. This limit applied to the entire account. Running these in parallel will likely cause us to hit our API limits which will result in random S3 calls failing. |
So I went and did a smoke test of this and it does speed up s3 quite a bit. It also makes us hit our rate limit on elb and autoscaling, and it's eating Exceptions. After I made the following change in each_difference we saw rate limits right away
This could be workable if we are not eating exceptions (some exceptions really do need to stop execution) and we need to also not do the sync in parallel. (each_difference is used by both diffing and syncing) and we need to only do it on modules that need it (s3 is probably okay). |
Also, do we need Paul's sublime text config in the repo? |
I'd expect nothing less from Ruby. |
No...it's not in the .gitignore :( I'll add it. |
This won't be hard to change. Where are the limits documented? |
e3b8c7e
to
2aac2b5
Compare
@krjackso, I think I've fixed the issues.
|
2aac2b5
to
8755dd4
Compare
The problem I'm seeing with the retries still is that we are still hitting the throttling limit, but just trying more times. Not sure that solution will work for something like ELB where we expect to not be throttled in other places, @dtorgy should be able to make that decision though. If we don't want parallelism for the modules we get rate limited on, we could have an opt-out value in config per-module pretty easily. Syncing in parallel shouldn't cause a problem that I can think of... We don't guarantee the order anyways when syncing so it should be no different. |
Retries are actually the AWS-recommended solution to hitting their undocumented limits.
But we don't save much on ELBs anyway -- they take seconds not minutes to diff -- so I'm fine with setting the parallelism per API. |
Solves #80
For me, it reduces an S3 diff from 140 to 20 seconds over wifi.