engineyard / ey-cookbooks-stable-v7

Other
6 stars 5 forks source link

Configure HTTP timeouts using environment variables #193

Open dvalfre opened 1 year ago

dvalfre commented 1 year ago

When it comes to timeouts on the HTTP processing pipeline, by default the recipes configure: HAProxy with 120 seconds, here. Nginx with 60 seconds, by default set by Nginx itself.

Besides both being different, which is a bug, we want the values to be configurable through environment variables. Thus, setting the variable EY_HTTP_TIMEOUT in seconds should configure the components as below (example for 180 seconds):

HAProxy (in milliseconds):

timeout client 180000
timeout connect 180000
timeout server 180000

Nginx (in seconds):

proxy_read_timeout 180s;
proxy_send_timeout 180s;
proxy_connect_timeout 180s;