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

Improve S3 asset read performance #17835

Merged
merged 16 commits into from Mar 20, 2023
Merged

Improve S3 asset read performance #17835

merged 16 commits into from Mar 20, 2023

Conversation

rijkvanzanten
Copy link
Member

@rijkvanzanten rijkvanzanten commented Mar 17, 2023

When doing very large quantities of read requests, the S3 Client has the chance to slow down / stall the process completely. By using a fresh S3 client instance for each read request, the API is able to process way more traffic from S3.

Todo

  • Run more tests to confirm improvements
  • Update index.test.ts
  • Re-enable type checking

@rijkvanzanten rijkvanzanten marked this pull request as ready for review March 20, 2023 19:37
@rijkvanzanten rijkvanzanten requested review from a team, freekrai, licitdev and jaads and removed request for a team March 20, 2023 19:37
Copy link
Member

@licitdev licitdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 🚀

Copy link
Contributor

@freekrai freekrai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, ran it against autocannon with a couple different scenarios to stress the resources on the box, and never hit any resource limits sending or accessing s3.

@rijkvanzanten rijkvanzanten merged commit 9526b4e into main Mar 20, 2023
5 checks passed
@rijkvanzanten rijkvanzanten deleted the asset-s3-read-perf branch March 20, 2023 22:16
@azrikahar azrikahar added this to the Next Release milestone Mar 21, 2023
meditadvisors pushed a commit to ciso360ai/directus-mod that referenced this pull request May 13, 2023
* Create new s3 client for each read

* Temp disable ts while debugging

* Add concurrency test

* Add minio to other tests

* Reduce unavailable count

* Trigger blackbox tests whenever packages are updated

* Prevent minio-mc from exiting

* Decrease requests and increase test timeout

* Spam more requests over longer period

* Increase request timeout

* Run autocannon directly with larger image

* Fix tests

* Lock version

* My favorite file

---------

Co-authored-by: ian <licitdev@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants