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

Add transfer configuration to support concurrent downloading #841

Open
ser-amzn opened this issue Jan 18, 2024 · 1 comment
Open

Add transfer configuration to support concurrent downloading #841

ser-amzn opened this issue Jan 18, 2024 · 1 comment

Comments

@ser-amzn
Copy link

I am trying to speed up downloading of large files from S3.

I can enable parallel downloading of file parts in boto3 using https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3.html:

    config = TransferConfig(
        multipart_threshold=1000000000,
        multipart_chunksize=50000000,
        max_concurrency=128,
    )
    s3_client.download_file(bucket, key, dst, Config=config)

Can I do the same in s3fs? if seems that passing s3_additional_kwargs doesn't help:

s3 = s3fs.S3FileSystem(anon=False, s3_additional_kwargs={'Config': config}) 

It would be great to have this feature in s3fs.

@martindurant
Copy link
Member

I don't believe that requesting parallel streams for a single file will increase bandwidth - you should simply saturate your network bandwidth once the transfer begins. Concurrency helps most when making many requests and wishing to amortise the latency.

(decoding and compression may parallelise well, but they are not normally significant, and python's GIL makes it hard to achieve)

Having said that, s3transfer does do some clever things, so if anyone is interested in calling it within get/download[_file], I would be interested to see 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

No branches or pull requests

2 participants