Welcome! Log In Create A New Profile

Advanced

Re: Limit reqs per user / bot

January 09, 2016 08:44AM
B.R. Wrote:
-------------------------------------------------------
> You should use limit_conn
> <http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html#limit_c
> onn>
> in conjunction with limit_req
> <http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_re
> q>.
> They are supplementing each other.
> ---
> *B. R.*
>
> On Fri, Jan 8, 2016 at 8:52 PM, djeyewater
> <nginx-forum@forum.nginx.org>
> wrote:
>
> > itpp2012 Wrote:
> > -------------------------------------------------------
> > > No because one user (web browser) can easily open 20 or more
> > > simultaneous connections to get a better web response.
> > > A bot might be less prone to do the same but most connect at about
> 5
> > > simultaneous connections.
> >
> >
> > The limit_req will only be used for requests to dynamic pages, so
> there
> > should only be one connection per user at a time.

But using my example config, which only allows 1 request per second per user, then wouldn't limit_conn be superfluous? You can't have more than one connection for a single request, surely?
I'll paste the config again here as it got missed off the previous quote:

map $http_user_agent $single_user {
default $binary_remote_addr;
~PaperLiBot 1;
}

limit_req_zone $single_user zone=one:10m rate=1r/s;

...

limit_req zone=one burst=2;
Subject Author Posted

Limit reqs per user / bot

djeyewater January 07, 2016 05:30PM

Re: Limit reqs per user / bot

itpp2012 January 08, 2016 01:39AM

Re: Limit reqs per user / bot

djeyewater January 08, 2016 02:52PM

Re: Limit reqs per user / bot

B.R. January 08, 2016 03:06PM

Re: Limit reqs per user / bot

djeyewater January 09, 2016 08:44AM

Re: Limit reqs per user / bot

B.R. January 10, 2016 09:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 233
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready