Francis Daly
January 25, 2017 02:10PM
On Tue, Jan 24, 2017 at 04:01:18PM -0800, Thangamani J wrote:

Hi there,

> I'm in process of implementing following use case, please help me with your
> inputs.
>
> let's say I have endpoint /rate-limit and it should
> 75% of time, it should return "SUCCESS" as text
> 25% of time, it should return "FAILED" as text

That doesn't sound like anything to do with rate limiting to me.

It sounds more like load balancing, where you want one case to receive
three times the load of the other.


On that basis, if it must be done purely in nginx.conf, I'd probably use
"upstream" with different "server" directives with different "weight"
arguments; and have the individual servers just "return 200 SUCCESS\n"
or "return 200 FAILURE\n".

The main directives there are documented from http://nginx.org/r/upstream

(Although really, I probably wouldn't do it purely in nginx.conf.)

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rate limiting by percentage

Thangamani J January 24, 2017 07:02PM

Re: Rate limiting by percentage

Francis Daly January 25, 2017 02:10PM

Re: Rate limiting by percentage

Igor A. Ippolitov January 26, 2017 02:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
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