Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Setting up an automatic HTTP Flood detector
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Setting up an automatic HTTP Flood detector

I am looking to setup something similar to Reddit's request rate limiting system (See http://i.imgur.com/B9idLzo.png for example). Is there an existing method to do this for varnish/nginx/apache? Or will I have to code a custom module or something?

I can see that nginx has ngx_http_limit_req can limit the number of requests, but it seems to be simply limiting the number of requests that can be performed, and either delaying or discarding the remainder. I would like to show a page instead of delaying or discarding the requests that are getting over the limit.

Comments

  • jarjar Patron Provider, Top Host, Veteran

    Off the top of my head I'm thinking something like mod_bw or simple rlimit values for Apache at least, that being more of my comfort zone than nginx for more in depth controls.

    Honestly an RLimitNPROC is my favorite way to just quickly say "Stop here, don't bother trying anymore at this point." I'm sure others will have more creative ideas :)

    http://httpd.apache.org/docs/2.2/mod/core.html#rlimitnproc

    Thanked by 1PrincessOfCats
  • edited February 2015

    Edit: Figured it out, ngx_http_limit_req has a configuration called limit_req_status code; which can then be used to set a custom error code. I can then set a page for the specific error code to show.

    Thanked by 2jar aglodek
  • Nginx has a rate limit feature.

Sign In or Register to comment.