I have request rate limit set as:
20 r/m
burst=4 delay=2
My expectation is that 1 request will be handled every 3 seconds. For any bursts, upto 4 requests (beyond the rate [1 per 3 seconds]) will be queued, of which 2 will be immediately handled and 2 will be handled such that it satisfies 1 req every 3 seconds.
I am testing using synchronous requests, by adding a delay of 3500ms after every 2 requests, followed by repeat of the same; I am seeing the following results:
Request1 (latency 250ms)
Delay 250ms
Request2 (latency 250ms)
Delay 3500ms
Request3 (latency 250ms)
Delay 250ms
Request4 (latency 250ms)
Delay 3500ms
Request5 (latency 250ms)
Delay 250ms
Request6 (latency 1000ms)
Delay 3500ms
Request7 (latency 2250ms)
Delay 250ms
Request8 (latency 250ms)
Delay 3500ms
Request9 (latency 2250ms)
Delay 250ms
Request10 (latency 250ms)
Delay 3500ms
Request11 (latency 2250ms)
Why do requests 6, 7, 9, 11 have the longer latency?