Table of contents
1.
Introduction
2.
Distributed Load Testing
2.1.
How does ReadyAPI support running distributed tests?
3.
Creating Distributed Load Tests
3.1.
Requirements
3.2.
Preparing the Project
3.3.
Adding and Configuring the Agents
3.4.
Switching to the Distributed Mode
3.5.
Running the Test
3.6.
Checking Test Results
4.
Frequently Asked Questions
4.1.
What is distributed load testing how can it be achieved?
4.2.
What is distributed load generation?
4.3.
What is an API?
5.
Conclusion
Last Updated: Mar 27, 2024

What is distributed load testing in performance tests in Ready API?

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

ReadyAPI is a low-code API testing platform for development teams that care about creating test automation across any workflow. The ReadyAPI ensures end-to-end quality for all your APIs and web services, connect and tests every API type, adds complex assertion logic without any scripting or code, and provides Flexible API testing options for continuous integration and deployment. This blog will especially see distributed load testings in ready API.

Distributed Load Testing

Simulating tens of thousands of fake user requests is a common practice while running load tests. The computer executing the test must devote many resources to simulating these consumers. Sometimes, one machine cannot produce a sufficient load to test the server adequately.

You can develop distributed tests to prevent this. Many PCs are used to replicate the demand on the target server during these testing. Each computer can manage the load generation simultaneously.

You can assess how well your server handles customers from different regions if the computers generating the load are located in various locations. Additionally, it results in a more accurate test. All users are unlikely to access your server from one computer, so running distributed tests makes the simulation closer to actual user behavior.

How does ReadyAPI support running distributed tests?

In ReadyAPI, distributed load tests are created on the Distribution page.

API distributed load testing with ReadyAPI: The Distribution Page

Image source

You can use any number of Agents to do these tests (an Agent is a computer running the LoadUI agent application).

Another option is to do a load test from a cloud, like the Amazon EC2 service. In this instance, you are exempt from providing hardware support for your load tests. Between cloud agents and ReadyAPI, all data that is transmitted is encoded.

Similar to tests on a local computer, agents also run load tests. Copy the readyapi-settings.xml file to the user folder on the agent PC to change the agent's settings. On any PC with ReadyAPI installed, this file is kept in the /.readyapi folder.

To change the maximum number of threads on the computer, modify the <con:setting id="UISettings@maxThreads">1000</con:setting> value.

Creating Distributed Load Tests

Requirements

For running distributed load tests, you need the given requirements to be met:

  • The ReadyAPI Performance license must be active. 
  • The LoadUI agent programme needs to be set up and functioning on Agents. The CLI can also be used to install it, but using the installation file and following the wizard's instructions is the simplest option.
  • On a PC with the LoadUI agent installed, open the connection port. The LoadUI agent utilises port 1991 by default. To communicate with ReadyAPI, use this port. Make sure this port is open for network connections if you use a proxy or firewall.
  • Ensure you have network access to the agents that simulate the test.

Preparing the Project

You need to prepare the project to be able to run it on agents:

  • Clear the Resource root project property or specify it as an absolute path. LoadUI agent do not support using ${projectDir} and ${workspaceDir} as values of the property.
     
Propect Properties: Clear the Resource Root property

Image source

  • Ensure that the agent has access to all external files, such as Excel files used in Data Source test stages, and that the paths leading to those files are given as absolute paths.
  • If your project has scripts that address an external library, place this library in the <LoadUIAgent>\bin\ext folder.
  • When conducting tests, the LoadUI agent doesn't employ a workspace. Because the getWorkspace() method returns null, as a result, programs that use it will not function. Your scripts must be changed to stop using the workspace object.
  • You must copy any plugins your project uses to the agent machine. To accomplish this, copy each file from the User folder/.soapui/plugins directory on the machine where the ReadyAPI is installed to the User folder/.soapui/plugins directory on the machine where the LoadUI agent is installed. Users who run the respective ReadyAPI and LoadUI agents are connected to user folders.

Adding and Configuring the Agents

To add and configure the agents:

  • In the load test editor, switch to the Distribution page.
     
API distributed load testing with ReadyAPI: The Distribution Page

Image source

  • Click on the toolbar.
     
API distributed load testing with ReadyAPI: The Add Agent Button

Image source

  • For the first agent, select the Running agent option and choose an agent from the list of detected agents. ReadyAPI displays all available agents in the local network. Click OK.
     
API distributed load testing with ReadyAPI: The Add Agent Dialog

Image source

  • Click again.
  • For the second agent, select the New agent option and enter its IP address or hostname in the Host field. You can also specify a different port to be used for the connection. You use this method to connect to agents that are not in your local network. ReadyAPI Performance does not display them on the Running agent list. Click OK. If you configured the agent correctly, it has the connected symbol (). If ReadyAPI cannot connect to the agent, it has the disconnected symbol ().
  • Now, drag the scenarios into the agents. If you add multiple scenarios, ReadyAPI Performance will simulate all of them simultaneously.
     
API distributed load testing with ReadyAPI: Created Agents

Image source

  • Before starting the test ensure that both agents are enabled. If any agent is disabled, Ready API will not stimulate tests on it.
API distributed load testing with ReadyAPI: Enabled Agents

Image source

  • You can choose and remove/add multiple agents at once by choosing the corresponding check boxes of each agent as given in the below image. You can also Deselect All or select All agents found in the network by using the corresponding buttons.
Add/Remove Multiple Agents

Image source

  • To make it simple to keep track of them, the network's agents are organized by name. The added agents' checkboxes are checked to indicate which of the listed agents have already been added when one or more agents are added to the Distribution and the Add Agent dialogue is opened.

Switching to the Distributed Mode

ReadyAPI doesn't perform tests on agents by default. Before performing your load test, you must switch it to the Distributed Mode. To achieve this, choose Run scenarios on agents from the drop-down menu next to the play button. The load test will then be executed on Agents.

API distributed load testing with ReadyAPI: Run Scenarios on Agents

Image source

Running the Test

To start the load test, click . ReadyAPI will start simulating requests on both Agents..

Checking Test Results

Visit the Statistics page now. Add a new statistics group to this page (click or ). When choosing which statistics to display, you can choose the statistics you need from the Agent. Select the agent name to get the agent's statistics. Click the sum of values for all agents if you want to see test statistics as a whole.

API distributed load testing with ReadyAPI: The Add Statistics Dialog

Image source

Frequently Asked Questions

What is distributed load testing how can it be achieved?

Running a test simultaneously on numerous distinct computers is known as distributed load testing. It entails creating a lot of traffic and enables the simulation of several virtual users. Because of this, we were using just one computer is insufficient.

What is distributed load generation?

Distributed Load Testing is where a heavy load is generated using multiple load generators. In standard load testing, the load is generated from a single machine, but to test huge user demand in real-time, we may need to distribute the load across different devices in different geolocations.

What is an API?

Application Programming Interfaces (APIs) provide data interchange and communication between two software systems. APIs serve as an interface between two applications, enabling communication between the two computer programs.

Conclusion

In this blog, we discussed about what is distributed load testing and its performance tests in Ready API. We also learnt about creating it. Along with this we learnt preparing, adding,switching to distributed networks, running tests and checking tests results.

For more content, Refer to our guided paths on Coding Ninjas Studio to upskill yourself.

Do upvote our blogs if you find them helpful and engaging!

Happy Learning!

Live masterclass