I regularly saw that performance testing are put aside, not really consider everyday while developing some services/features.
So today we will start a mini-serie about Software performance testing, talking about
- What is it?
- Why it's important ?
- How to do it? (Which tools and how to use it)
What is Software Performance Testing ?
Software Performance Testing is in general a testing practice performed to determine how a system performs in terms of responsiveness and stability under a particular workload. It can also serve to investigate, measure, validate or verify other quality attributes of the system, such as scalability, reliability and resource usage.
So what does it mean exactly ?
Imagine the following case.
- We have a microservice X which needs to talk to several APIS to retrieve customer datas.
- A request must be completed in 8 seconds max
- During one day, the microservice will receive between 5 and 10 TPS (Transactions Per Second)
- Every first day of the month, the number of calls increase to 25 TPS during one hour.
With only that, we have a lot of reliability tests to do. But which one ?
Several kinds of testing
The first one and the simple one, is to test if your service can deal with the expected load and respect the maximum time allowed for each request.
Based on our example, it's checking if the services (your api and all the other services) and the infra can support 25 TPS while all the requests are completed under 8 seconds.
It's a simple test but it can reveal some bottlenecks like :
- a service which can't go over 20 TPS
- a lack a resources (ex: CPU or memory for your service, for your database...)
- a non optimal configuration (ex: Thread pool define for a service which needs to access to a database...)
Then you can do a stress testing. This one is really important because you will increase the charge to know the limits of your system.
Also, if you haven't discovered a bottleneck on the load testing, you will see here which one it is. And you will know the gap you have between the expected load and the maximum supported.
It's really important to know that information, because if the number of TPS increase from 10 in a normal time to 1.000 you will want to know where you have to do something to support this new trafic.
Soak testing is the load testing but during a long period. The objective is to see if your system can endure a normal load.
Useful to check is everything is going well with the resources especially and avoid stack overflows.
Spike Testing consists by suddently increase and decrease by large the number of CPU.
The objective is to see if your system can absorb a massive increase without issues. (I saw some service able to go over 25 TPS but having issues when a spike came increasing the TPS from 5 to 25)
Also it will help you to test some infra elements that you can have like autoscalers.
I hope it will help you! 🍺
And see you for the next part : Why it's important ?
Top comments (0)