turn off proxy request buffering to allow for better upload streaming and fix super large uploads #1681
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #1663
I noticed that the upload stream was hanging after a couple GB. Eventually the connection on the client or the nginx gateway would timeout which would close the stream leaving an incomplete temp file and ultimately resulting in a
premature eof
error while extracting the archive. I also observed thatbuilder-api
did not begin to read the stream until the client had sent the entire file. That seemed odd since the http 1.1 chunked encoding should allow for proper streaming.I eventually tried bypassing nginx and sending the upload strictly to builder-api. This resulted in a successful upload as well as proper streaming behavior.
I later discovered the
proxy_request_buffering
setting in nginx. By default this is on and causes nginx to buffer the entire body before sending it off to builder-api. By turning it off, I got proper streaming and successful uploads. I'm still not clear why the stream was hanging, but this appears to fix the problem.Signed-off-by: Matt Wrock matt@mattwrock.com