-
Notifications
You must be signed in to change notification settings - Fork 0
Update configuration to improve performance and reliability #9
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
Conversation
49e5647 to
8fbeba3
Compare
44c8fba to
b41d975
Compare
* http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout * https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html * https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#http-502-issues * https://www.tessian.com/blog/how-to-fix-http-502-errors/
* http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size * https://serverfault.com/questions/875019/optimizing-nginx-client-body-buffer-size-for-web-app-accepting-file-uploads * https://stackoverflow.com/questions/35005130/nginx-client-body-buffer-size-and-client-max-body-size-optimizations-for-large-p * http://nginx.2469901.n2.nabble.com/request-body-and-client-body-buffer-size-td7586681.html
b41d975 to
0ab6f23
Compare
| * Set `proxy_connect_timeout` to `60s` (same as default). | ||
| * Set `proxy_send_timeout` to `60s` (same as default). | ||
| * Set `send_timeout` to `60s` (same as default). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set these explicitly figuring it's better to know what these values are at a glance without having to reference the niginx docs.
itskingori
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now ready for final ... 👀
zacblazic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions:
| sendfile on; | ||
| tcp_nopush on; | ||
|
|
||
| client_max_body_size 500m; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for increasing to 500m?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not real reason other than it feels like a nice round number 😅 ... 400m feels very random.
| proxy_connect_timeout 60s; | ||
| proxy_read_timeout 600s; | ||
| proxy_send_timeout 60s; | ||
| send_timeout 60s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we setting these to their defaults just for visibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. For visibility.
| tcp_nopush on; | ||
|
|
||
| client_max_body_size 500m; | ||
| client_body_buffer_size 128k; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intention behind increasing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some links in the commit for more context but the TL;DR is that it's to:
- Reduce the number of "a client request body is buffered to a temporary file" warning we get.
- Reduce the number of times nginx has to write file (search for above string in logs to see). Memory is faster. Also since we have
client_max_body_sizealso figured uploads would benefit too by having to write even less.
It's not that great of an issue, more like a nice-to-have rather than must-have. FYI, you can see evidence of this below ...
|
|
||
| client_max_body_size 500m; | ||
| client_body_buffer_size 128k; | ||
| client_body_timeout 300s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should align the client_body_timeout value with the client_header_timeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objections to that. Should probably have.

See commits for details. Each commit is an idea.