1
votes

we are trying to do load test using jmeter.Following is the scenario

Application1 : 2 req/min(Throttling tier)

Scenario 1: we have created jmeter script with number of threads 10 and rampup period 1,According to the throttling tier it should not accept more than 2 req/min but more than 2 request got proper response

screenshot

Scenarion 2: we have tested the same api same application with number of threads as 30 and rampup period 60.It is working as expected we got proper error response stating you have exceeded the limit

Scenario2

Can anyone please help us to understand the result of why it is failing in scenario 1

1
Which version of API Manager you are using?Abimaran Kugathasan
We are using api manager 2.1.0caesarjr
Do you see the same behavior in of scenario 1 in all the time?Abimaran Kugathasan
Yes I see the same behavior all the timecaesarjr

1 Answers

2
votes

The reason for this behavior is because Throttling is performed asynchronously, without blocking the incoming request. When the time gap between two requests are significantly large, this gives enough time for the throttling event to occur and hence the throttling accuracy is higher.

In your second test, you use 30 threads with a ramp up time of 60 seconds. This means that during the first 60 seconds of the test, there's a 2 second gap between each request (60/30). In the first test the gap between two requests is 1/10 = 0.1 seconds. So in the first test, there are many requests being sent within a very small time and hence by the time the throttling decision is taken and notified, a few more requests than the originally allowed have passed through. But in the second test there's a gap of 2 seconds between each request. So after the second request has passed through, the throttling engine makes the throttling decision and notifies the Gateway before another 2 seconds lapse. Therefore by the time the 3rd request arrives, the Gateway knowns that it should be throttled out.

In summary, when the time between requests is very small, the accuracy of the throttling counts can be less. Most practical scenarios are similar to your second test, where there's always a "think time" between two requests. In those cases the accuracy is high.