Adds domain based rate limiting to HAProxy for Pages
For https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/15689
This sets an optional domain based rate limit using HAProxy stick tables. By default the rate limit is off, once enabled we will default to 800 requests/second per domain.
A few things of note before reviewing this MR:
- We now have frontend peers for Pages haproxy, this is necessary so that we can track the request rate across all nodes as a unit.
- There are two frontends for pages,
pages_httpandpages_https.pages_httpsis atcpfrontend so we are unable to use theHostheader. Instead we usereq_ssl_sniwhich is the sni hostname. - Because
pages_httpsistcpwe can't issue a nice429response, instead we issue atcp-request content reject. this is not so nice on the browser. See https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/15689#note_939914641 . - Because ssl rejections are not tracked in status codes or any metric that I have been able to see, I moved these rejections into their own backends. This will allow us to track rejections at HAProxy specifically by looking at the session rate on the
deny_httpsbackend