0

How should the rate be interpreted in the nginx rate limiting module?

10 r/s means 1 request every 100ms - this means granularity is 100ms; and 2nd request within the 100ms will get rejected.

Does 30 r/m mean 1 request every 2 seconds (2000ms)? Thus granularity is 2000ms? Therefore 2nd request within the 2000ms will get rejected?

Similarly, 6 r/m means 1 request every 10 seconds (10000ms) Thus granularity is 10000ms?

Bob
  • 5,805
  • 7
  • 25
variable
  • 177
  • 2
  • 10
  • 1
    That appears the correct interpretation to me. – Bob Feb 16 '22 at 14:39
  • So the granularity is per request, and not millisecond really. – variable Feb 16 '22 at 15:18
  • The internal time keeping by nginx is with millisecond accuracy. When you have a rate of `10 r/s` AND don't allow bursts the subsequent request is rejected if it arrives between 0 and 99 milliseconds after after the previous permitted one. If it arrives exactly 100 milliseconds later (or much later) it will be permitted. – Bob Feb 17 '22 at 07:55
  • Can you give the example considering 12r/m - this makes the granularity at second level - so 5 second granularity right? – variable Feb 17 '22 at 10:10

0 Answers0