-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Performance improvement on the TCP connector with async DNS resolver #1260
Comments
is aiodns something that needs to be explicitly configured by aiobotocore or it enables by default as long as it's installed? btw, should we be concerned about aio-libs/aiodns#122 |
I am not familiar with |
AFK but according to docs you just need to install aiohttp with speedups and it should get used automatically https://docs.aiohttp.org/en/stable/ |
It is not, see aio-libs/aiohttp#2228. Something like this needs to be done: session = ClientSession(
connector=TCPConnector(resolver=AsyncResolver()),
) |
This could be an opt-in in the |
the way to handle this is adding an arg to AioClientConfig |
open to PRs! otherwise we'll get to this soon, good idea. btw I remember trying to use c-ares via aiodns several years ago while it was still new however it had some rather unfortunate issues so had to roll back. I'm sure it's more stable by now. |
so I looked at this more, we don't need to do anything.
given we don't override the resolver assuming your system supports aiodns it will get used. Will close this task unless you can point out an error in the above logic |
also note you can easily override the max parallel connections via AioConfig/Config. We follow the botocore defaults for now as I don't see a good reason to change it. It's kinda configured for hobby use, and up to user to "productionize" settings :) |
oops, forgot to close :) |
Opportunity
AIOHTTP TCP connector performance could be improved by using AIODNS. AIOHTTP maintainers explicitly recommends it. It technically uses c-ares as low-level resolver implementation.
Implementation
It should be located near that line:
aiobotocore/aiobotocore/httpsession.py
Lines 167 to 171 in 7432338
Straightforward to implement at the first view.
Impacts
Windows compatibility
Context:
Mitigation:
Performance
We should monitor performance as of automatic performance testing, to ensure this kind of change does not have unwanted effects.
Related
The current implementation limits parallel connections to 10, accordingly to the default setting in botocore:
https://github.com/boto/botocore/blob/26a4f341d5496e12696692904d1dc83b939b71b5/botocore/httpsession.py#L81
This is relatively low and certainly impacts performance. AIOHTTP maintainers recommend 100, again, it should be interesting to benchmark that.
The text was updated successfully, but these errors were encountered: