Welcome! Log In Create A New Profile

Advanced

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn
December 02, 2017 04:58AM
I want to set the rate limiting for the entire server not for each client ip.



童树山
咪咕视讯科技有限公司 研发部
Mobile:13818663262
Telephone:021-51856688(81275)
Email:tongshushan@migu.cn

From: Gary
Date: 2017-12-01 22:43
To: nginx
Subject: Re: How to control the total requests in Ngnix
Is this limiting for one connection or rate limiting for the entire server? I interpret this as a limit for one connection.

I got rid of the trailing period.
https://en.wikipedia.org/wiki/Leaky_bucket

A request is one line in the access log I assume, typically a html verb like "get". I use a single core VPS, so I don't have much CPU power. Unless the verb action is trivial, I doubt I would hit 2000/s. From experimentation, a burst of 10 gets the images going mostly unimpeded, and a rate of 10/s is where you see a page just start to slow down. I think a rate of 2000/s isn't much of a limit.






Original Message
From: mdounin@mdounin.ru
Sent: December 1, 2017 5:46 AM
To: nginx@nginx.org
Reply-to: nginx@nginx.org
Subject: Re: Re: How to control the total requests in Ngnix

Hello!

On Fri, Dec 01, 2017 at 11:18:06AM +0800, tongshushan@migu.cn wrote:

> I configured as below:
> limit_req_zone "all" zone=all:100m rate=2000r/s;
> limit_req zone=all burst=100 nodelay;
> but when testing,I use tool to send the request at: Qps:486.1(not reach 2000) I got the many many 503 error,and the error info as below:
>
> 2017/12/01 11:08:29 [error] 26592#37196: *15466 limiting requests, excess: 101.000 by zone "all", client: 127.0.0.1, server: localhost, request: "GET /private/rush2purchase/inventory/aquire?productId=product1 HTTP/1.1", host: "localhost"
>
> Why excess: 101.000? I set it as 2000r/s ?

You've configured "burst=100", and nginx starts to reject requests
when the accumulated number of requests (excess) exceeds
the configured burst size.

In short, the algorithm works as follows: every request increments
excess by 1, and decrements it according to the rate configured. If
the resulting value is greater than burst, the request is
rejected. You can read more about the algorithm used in
Wikipedia, see https://en.wikipedia.org/wiki/Leaky_bucket.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 04:14AM

回复: How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 04:16AM

Re: 回复: How to control the total requests in Ngnix

gariac November 30, 2017 04:46AM

Re: 回复: How to control the total requests in Ngnix

gariac November 30, 2017 01:56PM

Re: How to control the total requests in Ngnix

Francis Daly November 30, 2017 05:18AM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 06:54AM

Re: How to control the total requests in Ngnix

pbooth November 30, 2017 05:28PM

Re: How to control the total requests in Ngnix

gariac November 30, 2017 09:10PM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 09:14PM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 07:06AM

Re: Re: How to control the total requests in Ngnix

Francis Daly November 30, 2017 01:40PM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 10:20PM

Re: Re: How to control the total requests in Ngnix

Maxim Dounin December 01, 2017 08:48AM

Re: How to control the total requests in Ngnix

Maxim Dounin December 01, 2017 11:14AM

Re: Re: How to control the total requests in Ngnix

Francis Daly December 02, 2017 06:04AM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn December 02, 2017 11:00PM

Re: Re: How to control the total requests in Ngnix

Francis Daly December 05, 2017 03:54AM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn December 05, 2017 08:52PM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 11:54PM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn November 30, 2017 11:56PM

Re: Re: How to control the total requests in Ngnix

tongshushan@migu.cn December 02, 2017 04:58AM

Re: How to control the total requests in Ngnix

gariac November 30, 2017 11:18PM

Re: How to control the total requests in Ngnix

gariac December 01, 2017 09:46AM

Re: How to control the total requests in Ngnix

gariac December 03, 2017 04:10PM

Re: How to control the total requests in Ngnix

pbooth December 04, 2017 01:14AM

Re: How to control the total requests in Ngnix

pbooth December 04, 2017 04:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 181
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready