Replies: 3 comments 16 replies
-
see https://github.com/terrycain/aioboto3 for boto3 equivalents |
Beta Was this translation helpful? Give feedback.
-
Note that I'm not looking for boto3 APIs. I'm looking for caching of async clients. The aioboto3 examples do the same thing I described above, namely initialize clients just before using them. |
Beta Was this translation helpful? Give feedback.
-
@tibbe I was wondering if you've got anywhere with this one? I am rather surprised there's no information on this question. For example timestream client takes ages to initialize, so keeping the client between "warm" invocations would be obviously beneficial. After all the only reason we use aiobotocore is performance. |
Beta Was this translation helpful? Give feedback.
-
We're currently using regular
boto3
and to avoid Lambda cold start overhead we are creating sessions/clients at import time and store them in global variables. Something like:(We also use Lambda provisioned concurrency so not even the first request sees cold start overheads.)
What's the equivalent in
aiobotocore
? The examples seem to create the client just before making the request, which presumably incurs the cost of client creation.(If it matter we use FastAPI to create our server. Perhaps we should try to hold some state in our server object.)
Beta Was this translation helpful? Give feedback.
All reactions