How to do Load testing
- It is a non-Functional testing which aims to measure how a system performs under different user load. It is measured in terms of its responsiveness, stability, throughput, bandwidth utilised, hits or transactions per sec (achieved).
Performance Testing helps to understand:
- How a system is performing under peak load (maximum load on the system)
- The maximum capacity that can be reached with current infrastructure
- And thereby helps to plan for future load – capacity planning
Types of Performance testing:
- Load testing
- Stress testing
- Capacity testing
- Endurance testing
- Spike testing
- Volume testing
- It is a type of performance testing, where an application is tested with the expected number of users. This is done to get a clear picture of the application performance when the application will be made available to the target audience.
- It is one of the most common type of performance testing.
- Normal or expected user load is the load projected by the business team (should be realistic)
Starting with Load testing:
A) First and foremost, it is important to know the infrastructure used. Some of the important points worth knowing are –
The Application’s communication protocol as it helps to narrow down the tool that will be used for load test
Next, we need to know the technology used for developing the application – PHP, java, etc. Additionally, the DB used – Sql server, Oracle, mysql, postgresql, etc.
The Application/Web servers used – Tomcat, IIS Server, Jboss, Weblogic etc
Other components that are used like load balancer, mongoDb, solr search, etc
Any captcha used in any of the workflow. If yes, then we need to get it disabled in the testing Environment.
B) Next comes the selection of tool:
- There are various tools available in the market. Based on the needs, capabilities of the tools and affordability a tool must be selected for the test.
- Each tool has its advantages and disadvantages. Microfocus Loadrunner is pioneer in the load testing environment. But it comes at a very high cost and thus not many can afford it. On the other hand, Apache jMeter is the widely used open source tool which caters maximum needs of the users with its wide support to protocols.
- Some other tools worth mentioning are – Neotys Neoload, OATS, Gatling.
C) After tool is selected, we start with the identification of user workflows that we need to automate for our load testing.
- The workflows (test case) on which most of the users are usually present or expected to be are considered for load testing. These can be important flows from a business perspective.
- Then we will prepare a User Load Model which will help in understanding how the users are accessing the application. The percentage of users on approved workflows is calculated using this model. Here, we may need help of the business team to provide us the details with the data. Based on this information, a user load model is prepared and accordingly user load is calculated. Additionally, Google analytics can also provide important data which will help in creating the model.
- A simple model can have data such as Average Session Duration, Expected number of transaction in Peak hour per user, Expected Active Users during peak hour, Simultaneous Users, Percentage Distribution corresponding to each workflow.
D) Monitoring of servers:
- During the entire load test, we capture the resource utilized of servers present in the architecture. This is done to check the impact of the users and thus helps us to understand, plan and improve the code or either the capacity of resources. The servers can be windows or Linux based, and accordingly different utilities are used. Additionally, we analyse the impact on DB – slow queries, Deadlock are checked.
- At the final stage, different matrix captured are shared with the stakeholders. These matrix can be response times, throughput, hits per sec along with CPU, memory utilised during the entire load test.
- The scenario detail during the test
- Errors encountered
- The report can also provide information on possible performance degrading suspects.
Author : Paras Sharma