Timeout server should be set in frontend and backend
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Content Cache Charm |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Scenario: Indico application has a few long-running operations that require more time to finish properly so we need to change the timeout.
Environment:
Content Cache stable/167
How to reproduce (assuming that Indico is properly set, up and running):
1) Set the sites
juju config content-cache sites="
locations:
/:
backend-
backend-
backend-
backend-
backends: ['1.1.1.1:80']
backend-
extra-config:
- client_
- proxy_cache_bypass \$cookie_
- proxy_read_timeout 300s
"
Command here: https:/
2) Trigger a long-running operation (import of registrants)
curl 'http://
HAProxy log:
Mar 8 16:11:12 juju-07387c-2 haproxy[13741]: 10.42.91.1:36208 [08/Mar/
Mar 8 16:12:09 juju-07387c-2 haproxy[13741]: 127.0.0.1:42670 [08/Mar/
NGINX log:
10.42.91.1 - - [08/Mar/
Fix:
1) Manually change /etc/haproxy/
backend backend-
option httpchk GET /_status/
http-request set-header Host indico.local
http-request set-header X-Forwarded-For %[src]
balance leastconn
timeout server 300s
server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 50
backend backend-
option httpchk GET /health HTTP/1.1\r\nHost:\ indico.
http-request set-header Host indico.local
http-request set-header X-Forwarded-For %[src]
timeout server 300s
option redispatch 1
balance leastconn
server server_1 192.168.68.57:80 check inter 10s rise 2 fall 5 maxconn 50
Entire config here: https:/
Result (success):
HAProxy log:
Mar 8 16:29:50 juju-07387c-2 haproxy[15402]: 127.0.0.1:57576 [08/Mar/
Mar 8 16:29:50 juju-07387c-2 haproxy[15402]: 10.42.91.1:44940 [08/Mar/
NGINX log:
10.42.91.1 - - [08/Mar/
Changed in content-cache-charm: | |
status: | New → Won't Fix |
The "extra-config" is really for additional and custom Nginx configs. We don't really parse what's specified here to work out what options should also be added on the HAProxy side of things.
For HAProxy, we added "haproxy- extra-configs" per LP:1976176. I think this should do what you want:
| locations: check-method: GET max_body_ size 15m indico_ session extra-configs:
| /:
| backend-
| backend-check-path: /health
| backend-inter-time: 10s
| backend-maxconn: 50
| backends: ['1.1.1.1:80']
| backend-options: ['http-request set-header X-Forwarded-For %[src]','timeout server 300s']
| extra-config:
| - client_
| - proxy_cache_bypass \$cookie_
| - proxy_read_timeout 300s
| haproxy-
| - timeout server 300s
Let me know if not.