Best Practices for Load or Performance Testing
Clear browser cache and cookies before recording traffic. When the cache and cookies are not clean, while recording a user scenario, the web browser uses cached data and cookies to process client requests instead of sending data to and receiving responses from the server. However, with LoadNinja, this is not something you need to worry about, as we record tests using our TrueLoad Technology, which essentially spins up a new browser within your browser window to record and playback tests.
Start recording a new scenario from the web browser’s start. If you start recording a scenario after you connect to the tested web server and open a few web pages, the playback of the scenario will fail. This will happen because the recorded traffic will not reproduce the authentication procedure, and the tested web server will ignore the simulated requests.
Parameterize scenarios to simulate more realistic load on the server. Parameterizing scenarios involves replacing recorded parameters in the requests with variable values. This way you can make virtual users send user-specific data to the server. This lets you add dynamic behaviors to your scenarios as if they were run by a group of unique human users. Note: Before you parameterize a scenario, carefully explore its requests and responses to better understand what data is being transferred to and received from the server.
Verify user scenarios. Before creating tests on the basis of a recorded scenario, make sure that the scenario is executed successfully for one virtual user. This can help you identify bottlenecks of the scenario and eliminate problems which are not related to the number of virtual users and additional testing conditions.
Arrange user scenarios in your tests so that critical functionality is tested first. And remember to analyze and report on your results!
During test runs, monitor the tested server metrics as well as resource usage on the client computer where your load tests are running. You do not have to overly stress the client machine. Try to control the processor and memory usage metrics on the client computer and keep them below the threshold limit. Otherwise, the client computer may fail during your testing.
Do Not Do These Things When Load Testing
Do not run tests in real environments. A real environment can have other network traffic, and this may affect test results. To avoid excess data transfer, use a test environment that behaves in the same way as the real environment except that there is no other traffic usage.
Do not try to crash the tested server. The goal of web server performance testing is not to break the server, but to identify web application performance bottlenecks under various loads.
Do not browse web pages during test runs. This may affect the traffic simulation and make the test fail.
Do not overly stress the client test systems.
Do not use zero think time. Make sure that think time in your test is based on real-life conditions. Using zero think time does not provide realistic user simulation and puts an abnormal load on the tested server. However, omitting think time can help you determine bottleneck issues.
Check out our Load Testing Resource Center to learn more about generating load and simulating application performance!