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

Buffering issue #1

Open
thedentist8 opened this issue Mar 2, 2024 · 2 comments
Open

Buffering issue #1

thedentist8 opened this issue Mar 2, 2024 · 2 comments

Comments

@thedentist8
Copy link

thedentist8 commented Mar 2, 2024

Thanks for sharing this repo. I managed to get it up and running, however I'm facing an issue.

When a request is sent to Cloudflare, it first buffers the entire request body before it sends it to the worker for processing. For instance, if I try to upload a 100MB file, and the connection interrupts after 90MB is uploaded, then nothing will be stored in the R2 bucket as the request hasn't been processed by the Worker at all (it was just buffered by CF). Wondering if you've found a solution around this?

Thanks!

@thedentist8
Copy link
Author

@ravi-signal wondering if you have any thoughts on this.

@stupidloud
Copy link

stupidloud commented Mar 25, 2024

Thanks for sharing this repo. I managed to get it up and running, however I'm facing an issue.

When a request is sent to Cloudflare, it first buffers the entire request body before it sends it to the worker for processing. For instance, if I try to upload a 100MB file, and the connection interrupts after 90MB is uploaded, then nothing will be stored in the R2 bucket as the request hasn't been processed by the Worker at all (it was just buffered by CF). Wondering if you've found a solution around this?

Thanks!

That might because your worker had triggered the memory limit which is 128Mb.
The R2 documentary said you can use Streams API to get over this limit, but I don't know how to write this in code.
(referred to: https://developers.cloudflare.com/r2/api/workers/workers-api-usage/#4-access-your-r2-bucket-from-your-worker)
The other way is to set a chunksize option for your tus-client, below 100Mb. It works but the upload process will hang for a few seconds in each chunked subrequests, while it will bring down the upload speed significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants