How to find api breakpoint in gatling

Viewed 135

I want to find - After how many users the API will gets break. For eg. we should have a conclusive answer about a particular API that gets breaks for 1000 users and works fine for 999 users. Can we achieve the same with Gatling? And if someone knows its approach then let me know.

1 Answers

What you are looking for is rampConcurrentUsers injection profile. It allows you to keep certain amount of active users and then increase that amount every next second. For example:

rampConcurrentUsers(500).to(1500).during(1000 seconds)

This will start with 500 concurrent users and will increase that number until will reach 1500 users after 1000 seconds (so it will add 1 user each second).

But from my experience, even if you will result in some number of users that does not mean that your system can handle that amount. Usually the system fails some time after it reaches its peak potential, as tasks and processes are queuing and until the first of them start to time out you won't see any errors, only performance will be affected. So if you will reach a certain number of users, I would recommend starting testing if the system can survive constant load of 90% of that number for longer time (5-10 minutes) and if so, then increase it until you will hit a point when that constant load causes system to fail. If 90% of the load is too much, do the opposite, start decreasing load until you will reach a point where system can survive that 5-10 minutes.

Related