#1936 async s3fs plugin
Pull request opened by
troychiu
TL;DR
Implement AsyncS3FileSystem which overrides _put_file() and _get_file() of S3FileSystem to improve performance on speed.
Type
☐ Bug Fix
☐ Feature
☑︎ Plugin
Are all requirements met?
☑︎ Code completed
☑︎ Smoke tested
☑︎ Unit tests added
☑︎ Code documentation added
☐ Any pending items have an associated Issue
Complete description
In this PR, I implement a flytekit plugin which overrides _put_file() and _get_file() of S3FileSystem. In my implementation, I leverage asyncio to upload/download multiple chunks at the same time to improve the speed by more than
100% with reasonable memory usage.
Performance
Since the internet speed is unstable, I use three different environments to test the plugin.
1. local (minio)
2. local (minio) with rtt=20ms (
https://github.com/sitespeedio/throttle)
3. s3 (a little bit unstable on my side)
and below is the result
Put file
Put object to local (minio)
Put object to local (minio) with rtt=20ms
Put object to s3
Get file
Get object to local (minio)
Get object to local (minio) with rtt=20ms
Get object to s3
Memory usage
Put file
As you can see, although the memory usage of async s3fs is a little bit more than s3fs, it will not increase as the file size grows.
1024MB
s3fs
s3fs async
2048MB
Get file
The memory usages of async s3fs and s3fs are at the same level.
1024MB
s3fs
async s3fs
2048MB
Tracking Issue
Follow-up issue
flyteorg/flytekit
✅ All checks have passed
30/30 successful checks