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

Protection against memory spikes when downloading assets #31

Merged
merged 8 commits into from
Jul 29, 2024

Conversation

ababic
Copy link
Collaborator

@ababic ababic commented Jul 3, 2024

Rewrites asset download functions to stream file contents into memory, instead of reading it all in one go.

It also adds the BYNDER_MAX_DOCUMENT_FILE_SIZE and BYNDER_MAX_IMAGE_FILE_SIZE settings, which provides a way for apps to place an upper boundary on the sizes of files they attempt to load into memory, reducing the likelihood of spikes during download. The default value of 5MB is quite conservative, but can be increased to fit the project setup (as outlined in the updated docs)

@ababic ababic marked this pull request as draft July 3, 2024 10:00
@ababic ababic force-pushed the feature/max-asset-file-size branch 3 times, most recently from d6d19dc to d4ac0c8 Compare July 5, 2024 10:20
@ababic ababic marked this pull request as ready for review July 5, 2024 10:35
@ababic ababic marked this pull request as draft July 5, 2024 10:35
@ababic ababic marked this pull request as ready for review July 5, 2024 11:13
@ababic ababic force-pushed the feature/max-asset-file-size branch 4 times, most recently from 4db908c to f45f957 Compare July 10, 2024 14:45
@ababic ababic force-pushed the feature/max-asset-file-size branch from f45f957 to dc6f38a Compare July 29, 2024 15:02
@ababic ababic merged commit 53327fe into main Jul 29, 2024
6 checks passed
@ababic ababic deleted the feature/max-asset-file-size branch July 29, 2024 15:07
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

Successfully merging this pull request may close these issues.

1 participant