-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
buffer size for multipart s3 downloads #691
Comments
In the benchmarks above, I downloaded the file to an EBS volume, which is perhaps less than ideal since that depends on the network connection to, if I understand correctly. However, I've seen similar differences in performance between boto3 and awscli on local storage on a d2.8xlarge instance. IIRC, the difference was even more pronounced in that case, perhaps because of the 10 gbps networking of the d2.8xlarge. |
This is definitely something you may see if the configurations are not appropriate for the manager. I would really recommend read this thread and comment in a similar implementation as to why this is the case: boto/s3transfer#13 (comment). Based on that discussion, we may need to update the defaults in boto3. If you are able to follow along, I would recommend setting a multipart_chunksize such that the following is True if you do not want to mess with the source code:
When you bumped the io chunksize to 1024KB does that make the performance more comparable to the CLI? That is the io chunksize it uses. |
Ah, I forgot to mention how long awscli takes above. awscli takes about 90 seconds on the same machine for the same file, so it's still a bit faster than with boto3 when I changed the io chunksize to 1024KB, but not too much. I'll try fiddling around with the multipart_chunksize and/or max_io next... |
Another data point: it took 113 seconds to download the 8GB file with the following settings, where I just bumped up the IO queue size to be way larger than necessary to satisfy the inequality above.
|
I also just tried the following settings, which are the same as the ones I used for the tests at the top of this thread except with a smaller
|
I'm encountering an identical problem. I was experiencing nearly 3 times the performance using the AWS CLI as opposed to boto. AWS CLI (aws-cli/1.10.33 botocore/1.4.23) is using the out of the box defaults. I'm using boto3 1.3.1 and using all default settings for my TransferConfig. I played with max_io_queue settings as @mheilman did with little effect - for a 5GiB file I'm downloading it in roughly 44 seconds. Tested as follows:
I tried all the settings suggested above focusing on All my testing was done on a m4.10xl instance running Amazon AMI. |
@gisjedi, thanks for adding your observations. It's good to know I'm not the only one seeing this. While the differences I've posted above were smaller, I've also seen a similar 3x speed difference between boto3 and awscli on an d2.8xlarge instance with 10 gbps networking (the g2.2xlarge instance I used for the tests above has maybe 1 gbps). |
fwiw, I tried commenting out the lines that queue up IO chunks here (and put a |
Hmm it sounds like the theory that the slowness has to do with the io queue is correct. |
Also relevant: #737 |
With the release of 1.4.0 of boto3, you now have the option to both It is important to note that with the current configuration, the defaults should be suitable. Now the Closing out issue as the defaults should now be resulting in better performance and the necessary configuration parameters related to io are now exposed to tweak to make the download faster if the results from using the defaults are still not as desired. |
I noticed recently that for a large download, the awscli (
aws s3 cp s3://...
) was faster than usingboto3.s3.transfer.MultipartDownloader
.After running a few tests of downloading an 8GB file, it looks like maybe the size of the I/O buffer here may have something to do with it. I don't understand why, but making that buffer size larger (e.g., 256KB or 1024KB instead of the current 16KB) seems to improve download speeds consistently for me.
Perhaps that buffer size should be increased, or maybe just made configurable? I don't understand the pros and cons other than that making it larger seems to help for my use case.
Times for downloading an 8GB file from S3 to a g2.2xlarge instance (I just changed the number in the line of code mentioned above):
Code for testing:
I previously mentioned this here.
The text was updated successfully, but these errors were encountered: