Rate limiting intervals

Hello,

With the rate limiting module you can easily rate limit based on seconds
or
on minutes.
What I would like to do however is rate limit based on a 100 millisecond
or
10 millisecond interval.

That way you do not have a burst of requests at the beginning of a
second.
But a more continuous flow of requests.

Is this possible with nginx?
If not can anyone point me to the right location in the source where the
rate limiting is actually done.

(I assume it has something to do with ngx_http_limit_req_lookup in
ngx_http_limit_req_module.c)

Thanks in advance,
Pieter

Posted at Nginx Forum:

On Friday 17 January 2014 16:52:31 PieterVI wrote:

Hello,

With the rate limiting module you can easily rate limit based on seconds or
on minutes.
What I would like to do however is rate limit based on a 100 millisecond or
10 millisecond interval.
[…]

100r/s is an equivalent of 1 request per 10 milliseconds.

wbr, Valentin V. Bartenev

On Friday 17 January 2014 18:26:09 PieterVI wrote:

Hi Valentin,

I know that 100r/s is equal to 1 request per 10 milliseconds.

If you specifiy 100r/s nginx will send 100 requests within the first
milliseconds of a certain second.
[…]

Yes, but only if you have set burst=100.

There is no second/minute granularity in limit_req module. It’s just a
measure.

If you set 100r/s with zero burst, then every request received in less
than 10 milliseconds after the previous permitted one will be declined.

wbr, Valentin V. Bartenev

Hi Valentin,

Thanks for the info. That indeed does seem to work as you mention.
I have to figure out what else is going wrong then.

Thanks,
Pieter

Posted at Nginx Forum:

Hi Valentin,

I know that 100r/s is equal to 1 request per 10 milliseconds.

If you specifiy 100r/s nginx will send 100 requests within the first
milliseconds of a certain second.
Once these request are done no request will be handled anymore.

When you would be able to specifiy more granular rate limiting interval
you
whould be able to get a more continuous load.
see: Startseite - imagebin.org

Kind regards,
Pieter

Posted at Nginx Forum: