Thanks Joris, Willy, exactly what I needed ! On Fri, Jul 10, 2015 at 4:19 AM, Willy Tarreau <[email protected]> wrote:
> On Fri, Jul 10, 2015 at 08:39:59AM +0200, joris dedieu wrote: > > 2015-07-08 15:28 GMT+02:00 Bastien Chong <[email protected]>: > > > Hi, > > > > > > I'd like to rate-limit a specific path, by rate-limit I mean continue > to > > > accept X req/s, and buffer or drop subsequent requests over the limit. > That > > > is was "rate-limit sessions <rate>" does, but is frontend-wise. > > > > It's not optimal but you can use a "pipe" > > > > frontend myfront > > ... > > use_backend pipe_in if { condition } > > > > backend pipe_in > > server pipe_out 127.0.0.1:8080 > > > > listen pipe_out > > bind 127.0.0.1:8080 > > rate-limit sessions 10 > > server ... > > That's indeed the principle to apply normally, also don't forget to set > a maxconn value on the pipe_out server so that it queues extra connections. > It's also possible to set a maxqueue and a timeout queue to decide to abort > requests waiting too long for a slot. > > Regards, > Willy > >

