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
generate_presigned_url is 3x as slow as boto2 for s3 resources #217
Comments
Confirmed the symptom. Will need to profile it to find the bottleneck. |
@adepue Quick question, is your use case that you're generating a large number of these presigned URLs all at once? From the output above, generating a presigned URL in boto3 looks like it takes 5.69024801254 /10000 or about 0.57 milliseconds which comes out to a rate of 1757 presigned urls per second vs. boto2's 5105 presigned urls a second. We'll look at improving the speed in boto3, but it would be helpful to understand how you're currently using the presigner. |
I was generating 12 to 16 of these per page render for links to thumbnail images stored in s3. Under load, with 32 web server processes running on a machine, this generated significant load increase. |
Any news on this? boto3 generate_presigned_url is quite slow to generate bulk urls. |
any news on this issue ? |
Any updates? |
Any updates on this? |
Ran into this problem today. Found it really frustrating, as it was increasing the response time of my API endpoint by 3-4 seconds which was rather significant. And I was generating URLs for only ~30 objects. Any news on this being addressed in the near future? |
I had the same problem. Solved by setting AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY. When I migrate my servers to ECS it was no longer necessary to use AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY, since everything was on the same security layer. But when I removed those credentials, my application starts performing low |
I profiled the Here are my observations:
These, and several more things, all add up to the result documented on this thread. On my end, we're going to roll our own simple version to generate these presigned urls while trying to eliminate as much overhead as possible from the process. |
I faced this issue and resolved it by stopping reinitializing the client each time I wanted to pre-sign the URL. means in case you wish to pre-sign bulk resources only initiate the client once then loop over the resources you want to pre-sign them using the client you initialized at the beginning. |
Checking in here. Generally if you're not using a session, it takes longer to create the client to load the models. Creating the session would be a one-time hit. |
I abandoned boto3 for this use case some years ago. I'm not in a position to validate it anymore and am happy with anyone else signing off if closing the issue. |
The boto3 team has recently announced that the Resource interface has entered a feature freeze and won’t be accepting new changes at this time: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html. We’ll be closing existing feature requests, such as this issue, to avoid any confusion on current implementation status. We do appreciate your feedback and will ensure it’s considered in future feature decisions. We’d like to highlight that all existing code using resources is supported and will continue to work in Boto3. No action is needed from users of the library. |
When calling generate_presigned_url on a s3 resource, the resulting calls are 3x as slow as the boto2 equivalent...
This was run on c3.xlarge instances in us-west-2.
The text was updated successfully, but these errors were encountered: