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

nginx.conf: Use equal values for client_body_buffer_size and client_m… #28

Merged
2 commits merged into from
Dec 12, 2017

Conversation

pcarranzav
Copy link

…ax_body_size to avoid writing big files to disk

Idea taken from https://medium.com/urban-massage-product/nginx-with-docker-easier-said-than-done-d1b5815d00d0 after noticing a user pushing a big layer
causing out of space errors writing to /var/cache/nginx.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez [email protected]


Contributor checklist
  • Build output has been rebuilt and tested
  • Introduces security considerations
  • Tests are included
  • Documentation is added or changed
  • Affects the development, build or deployment processes of the component
Reviewer Guidelines
  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

nginx.conf Outdated
@@ -43,6 +43,10 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Add to x-forward-for
proxy_read_timeout 900;
proxy_buffering off;
# These two should be the same or nginx will start writing
# large request bodies to temp files
client_body_buffer_size 10m;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want 10m? Is that the default buffer size?

Copy link
Author

Choose a reason for hiding this comment

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

From http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size looks like default values are 1m and 16k - having a bit larger sounds like a good idea right? But I guess the important part, judging from the Medium post, is that they're the same? rather than the value itself

(playing by ear here)

@brownjohnf
Copy link
Contributor

brownjohnf commented Dec 8, 2017 via email

@pcarranzav
Copy link
Author

That's a good point. I'll put both in 1m, that is the largest of the two defaults.

@pcarranzav
Copy link
Author

Connects-to: https://github.com/resin-io/hq/issues/1115

…ax_body_size to avoid writing big files to disk

Idea taken from https://medium.com/urban-massage-product/nginx-with-docker-easier-said-than-done-d1b5815d00d0 after noticing a user pushing a big layer
causing out of space errors writing to /var/cache/nginx.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <[email protected]>
@pcarranzav pcarranzav force-pushed the nginx-client-body-buffer branch from 10cf649 to 4159eb5 Compare December 9, 2017 06:18
Copy link
Member

@dfunckt dfunckt left a comment

Choose a reason for hiding this comment

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

Great find @pcarranzav !

@ghost
Copy link

ghost commented Dec 11, 2017

VersionBot failed to commit a new version to prepare a merge for the above pull request here: #28. The reason for this is:
Cloning of branch nginx-client-body-buffer in resin-io/resin-registry2 failed
Please carry out relevant changes or alert an appropriate admin.

@ghost
Copy link

ghost commented Dec 11, 2017

@pcarranzav, status checks have failed for this PR. Please make appropriate changes and recommit.

@dfunckt
Copy link
Member

dfunckt commented Dec 11, 2017

I think it should help with #8 as well

This pull request was closed.
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.

3 participants