Skip to content

Commit

Permalink
Merge pull request puma#2313 from sairam/patch-1
Browse files Browse the repository at this point in the history
[changelog skip] [ci skip] fix HAProxy configuration for X-Request-Start header
  • Loading branch information
nateberkopec committed Jul 21, 2020
2 parents f231633 + 8ae0fbb commit df57cec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/deployment.md
Expand Up @@ -66,7 +66,8 @@ thread to become available.

* Have your upstream proxy set a header with the time it received the request:
* nginx: `proxy_set_header X-Request-Start "${msec}";`
* haproxy: `http-request set-header X-Request-Start "%t";`
* haproxy >= 1.9: `http-request set-header X-Request-Start t=%[date()]%[date_us()]`
* haproxy < 1.9: `http-request set-header X-Request-Start t=%[date()]`
* In your Rack middleware, determine the amount of time elapsed since `X-Request-Start`.
* To improve accuracy, you will want to subtract time spent waiting for slow clients:
* `env['puma.request_body_wait']` contains the number of milliseconds Puma spent
Expand Down

0 comments on commit df57cec

Please sign in to comment.