To return the 429 response code, use the "errorfile 403" directive and replace the 403 code in the file by 429.
Baptiste On Wed, Jan 20, 2016 at 12:30 AM, Chad Lavoie <[email protected]> wrote: > Greetings, > > I'd use the following four lines in a backend: > stick-table type integer size 1 expire 1m store http_req_rate(1s) > tcp-request content track-sc0 be_id() > acl enough_log_data sc_http_req_rate(0) gt 2 > http-request deny if enough_log_data > > If you want to use that in a frontend instead just replace the be_id with > fe_id. That function doesn't really serve any purpose other then to return > a static value to be stored in the stick table. > > That returns a 403 error when the limit is exceeded... I don't think there > is a good way to return a 429 response without making it substantially more > complicated. > > - Chad > > > On 01/19/2016 05:47 PM, CJ Ess wrote: >> >> I'm looking to limit requests per second on a per-backend basis (not per >> IP or per url, just per second). >> >> The backend itself just forwards requests w/ samples of performance data >> to a logging backend - beyond X per second we have all the samples we need >> and can discard the rest (pref HTTP code 429) so as not to overload the >> logger process. >> >> Anyone have a quick example how to do that? >> >> > >

