<#1936 async s3fs plugin> Pull request opened by <...
# flyte-github
a
#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_local_4▾

Put object to local (minio) with rtt=20ms

put_local_4_20▾

Put object to s3

put_s3▾

Get file Get object to local (minio)

get_local▾

Get object to local (minio) with rtt=20ms

get_local_20▾

Get object to s3

get_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

mem_s3fs_put_s3_1024▾

s3fs async

mem_async_put_s3_1024▾

2048MB

mem_s3fs_put_s3_2048▾

mem_async_s3_put_2048▾

Get file The memory usages of async s3fs and s3fs are at the same level. 1024MB s3fs

mem_s3fs_get_s3_1024▾

async s3fs

mem_async_get_s3_1024▾

2048MB

mem_s3fs_get_s3_2048▾

mem_async_get_s3_2048▾

Tracking Issue Follow-up issue flyteorg/flytekit ✅ All checks have passed 30/30 successful checks
#1936 async s3fs plugin Pull request ready for review by troychiu flyteorg/flytekit