Table of contents
1.
Introduction
2.
Load Type
2.1.
VUs
2.2.
Rate
3.
Set Virtual User Number
3.1.
What are the possible issues?
3.2.
What factors affect resource consumption?
3.3.
How to fix issues?
3.4.
How to find the maximum number of VUs a computer can run?
4.
Preparing Functional Test Cases for Load Test
5.
Frequently Asked Questions
5.1.
What is user load in performance testing?
5.2.
What is load testing API?
5.3.
What aspects are tested while performing load tests on API?
5.4.
Are load testing and performance testing the same?
6.
Conclusion
Last Updated: Mar 27, 2024

Load Type, Users, and Test cases related to Performance tests in Ready API

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

Introduction

ReadyAPI is a no-code API testing platform that is designed to simplify your testing workflows. End-to-end tests can be automated and scaled across multiple API types. Run load tests that are compatible with your functional tests. Allow virtualization to ensure that your development teams have fast and reliable integrations.

introductory img

In this tutorial, we will learn about load type, VUs, rate, Virtual user number, test cases related to performance tests in Ready API, and many more things.

Let’s start with the Load Type!

Load Type

The Load Type and Load Profile settings are used to specify how our test should simulate the load. For our tests, we can use either VUs or Rate load type.

VUs

When we choose the VUs(Virtual Users) test type, the load profile settings specify the number of virtual users who can work on the server at the same time. This number can be constant (fixed) throughout the test run, or it can vary depending on the load profile selected.

If a virtual user stops working because its test case is complete, Ready API waits for the specified Wait Time before starting a new user in order to keep the required number of virtual users. The pause before restarting the virtual user simulates the time between one user leaving the server and another beginning to use it.

load type

We recommend that there should be some time allowed for your requests to be processed. If you set the wait time to zero and the target simulation runs quickly, Ready API may require more processing power than a computer can provide.

Even if the server slows down, Ready API maintains the specified number of virtual users.

In the case of non-fixed load profiles, the current number of virtual users may differ from the number specified by the profile at times. In this instance:

  • If the current number is less than the required number, Ready API will launch additional virtual users to meet the requirement.
  • Ready API will not terminate "extra" virtual users if the current number is greater than the required number. It will simply wait for their simulation to end.

Rate

If we chose Rate load for a test, the load profile settings determine how frequently "users" visit the tested server. In other words, the profile does not specify the number of concurrent virtual users on the server, but rather the number of users who connect to it every second, minute, or hour.

rate load type

Ready API does not restart virtual users that stop.

If the virtual user simulation takes longer than the arrival time, the server load may increase significantly.

Set Virtual User Number

Ready API mimics virtual users (or VUs for short). Each user executes a scenario, which is a collection of functional test cases, test suites, or individual requests. Virtual users can run only once during the load test run, or they can restart after their scenario is finished, depending on the test properties. Our Ready API Performance license limits the number of concurrent virtual users that our test can simulate.

The Load Allocation property of the test determines how many virtual users your test will simulate. We can add it to the load test editor's toolbar.

What are the possible issues?

Virtual user simulation consumes memory and processing power on our computer. If these resources are insufficient for simulation, we will notice a decrease in performance or even a crash. Let's look at why this happens and how we can resolve these issues.

Resources that are important are as follows:

  • The amount of RAM available for the Java machine used by Ready API. This figure is determined by the total amount of RAM on your computer. Memory is required to store request and response data, as well as virtual user results
  • The CPU's processing power. It is required in order to simulate virtual users and manage their data (each user works in a separate thread in the OS).

What factors affect resource consumption?

The number of currently running virtual users.

This number is determined by your load test's VUs (or Arriving users) and Load Type properties, as well as the work time of each user scenario.

The size of simulated scenarios. The more requests in a scenario, the more memory its request and response data take up.

The presence and number of target loops in simulated scenarios. Target loops increase the number of simulated requests and responses, which means that they consume more memory.

File and hard drive operations. When compared to data exchange in memory, reading and writing files are time-consuming operations. The longer virtual users work, the more file operations your functional test cases have.

Other applications and services that are running on the computer where your load tests are being performed. They use memory and CPU power, so Ready API Performance will have fewer resources to work with.

How to fix issues?

  • First, we recommend that you examine the load test properties to see if they meet our requirements or if they were set incorrectly. For example, we might want to consider whether we really need that many virtual users arriving at the tested server every second.
  • If the properties are correct, then using multiple computers to generate the required load is the best solution. For more information, see About Distributed Load Testing. Another option is to run our test on a different computer with more RAM and a more powerful CPU.
  • Try one of the following (or both) to generate load from your current computer:
  • Increase the amount of RAM available on your computer for Ready API.
  • Modify the load test parameters. Check the work time of the test cases your virtual users run, as well as the values of your load test's Load Type and VUs properties. If the Load Type is Rate, set the "arrival" period to a reasonable length to avoid a rapid increase in the number of concurrent VUs on your computer.
  • Also, choose an appropriate number of simulated virtual users. 

How to find the maximum number of VUs a computer can run?

In your load tests, it is recommended that you use about 1,000 virtual users per machine.

However, keep in mind that this is an estimate. Because the impact of the factors described above is not precisely defined, no formula can provide an exact answer. You must use the trial-and-error method to find an answer. Run your load test with the number of virtual users you want. If the test fails, reduce the number and rerun it. If the test succeeds, increase the number and try again.

Preparing Functional Test Cases for Load Test

Functional test cases serve as the foundation for load tests. Typically, you create a functional test case that simulates real-world user behavior. However, not every functional test can completely comply with load testing specifications. To use a functional test for load testing, follow these guidelines:

  • Instead of Test Suite, Project, or Global properties, use Test Case custom properties.
  • Use the Run Test Case test step only once.
  • Sharing should be enabled for the Data Sources and DataGen test steps.
  • Distribute the Data Sink test step.
  • Prepare scripts for the desired test cases.

Frequently Asked Questions

What is user load in performance testing?

A load test is a type of performance test that examines how systems perform when a large number of concurrent virtual users perform transactions over a specific time period. 

What is load testing API?

It's a way to see if your application is robust enough to handle the load you want it to handle before your users do.

What aspects are tested while performing load tests on API?

You can monitor response times, throughput, server conditions, and more during load testing. However, the goal of load testing is not to break the target environment.

Are load testing and performance testing the same?

The goal of performance testing is to assess the overall system's performance while Load testing is a technique for determining whether an application can withstand the expected load.

Conclusion

In this tutorial, I tried to explain different aspects of Load Type, Virtual Users, and Test cases related to Performance tests in Ready API. I covered why and how of all the topics related to Performance testing, Virtual Users, and Load type.

Don’t stop here! Learn about Licensing of Ready API and updating and refactoring in Ready API  to sharpen your concepts and deepen your knowledge.

Live masterclass