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

Tune default timeout and max_threads #305

Merged
merged 2 commits into from
Oct 27, 2021

Conversation

dmsimard
Copy link
Contributor

@dmsimard dmsimard commented Sep 1, 2021

We should wait less than 300s before retrying. Probably make it configurable.

@dmsimard dmsimard marked this pull request as draft September 1, 2021 00:40
@abadger
Copy link
Contributor

abadger commented Sep 29, 2021

30s might be a better default.

For how to add a new config option, you can look at this: 4ebdac2

It implements both config and command line args for breadcrumbs and index generation. I don't think that a CLI arg is needed for the timeout parameter so you can ignore those portions. The code that deals with max_retries might be another thing to look at as it is similar to this (something internal that we want to make configurable for exceptional cases. Only settable via config. An integer value).

@dmsimard dmsimard changed the title WIP: Override the default 300s aiohttp.get timeout Tune default timeout and max_threads Oct 27, 2021
@dmsimard dmsimard marked this pull request as ready for review October 27, 2021 17:27
@dmsimard
Copy link
Contributor Author

I've tweaked the default timeout to 20s (up from 10s), I think 30s is long but I agree that 10s is short.
I haven't made it configurable for now though we could consider doing it later if we find out it's necessary to tweak it -- my main issue was the 300s default timeout which caused my builds to take up to 20 minutes instead of less than 5.

I snuck in a somewhat related commit to lower the default amount of threads so we don't get rate-limited as much.

Because we didn't set a value for the timeout, we ended up falling back
to the default aiohttp.get timeout which is 300s (5 minutes!) and that's
a very long time to wait before retrying.

20s is long enough that it should be sufficient.
Multi-threading improves performance but services we are interacting
with (such as galaxy) are rate limited.

Having a higher number of threads means we are more likely to hammer the
service and get HTTP 429 errors in return which means needing to timeout
and retry which leads to increased overall build time.

Having less threads won't be as fast but should also result in less
HTTP 429s, timeouts and retries so better performance overwall.
@felixfontein felixfontein merged commit aed085e into ansible-community:main Oct 27, 2021
@felixfontein
Copy link
Collaborator

@dmsimard thanks for the improvements!

@felixfontein
Copy link
Collaborator

It turns out that this PR actually does not change the default for max_threads. #365 fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants