What are Virtual Users in Load Testing

What are Virtual Users in Load Testing

The Virtual Users option when creating a new load test represents Number of Users to hit the application in parallel over a period of time.

This is Useful for identifying application behaviour when x clients connect on the app in parallel over a period of time.

Virtual Concurrent Users in Load Testing for Websites and APIs

Virtual Concurrent Users (VCUs) play a pivotal role in the realm of load testing for websites and APIs. To understand their significance, let's break down the concept.

What are Virtual Concurrent Users?

In the context of load testing, a VCU is a simulated user who interacts with your website or API just as a real user would. However, unlike real users who might take breaks between actions (like reading content, filling out a form, etc.), VCUs execute predefined actions without any pause unless explicitly specified in the test script.

Why are they important?

  1. Simulate Real-world Scenarios: Load testing aims to determine how your system performs under expected loads. By using VCUs, you can mimic the behavior of multiple users accessing your system simultaneously, revealing potential bottlenecks or performance issues.
  2. Flexibility in Testing: VCUs allow you to ramp up the number of users gradually, helping you understand at what point your system starts to degrade or fail. For instance, you can start with 100 VCUs and increase to 10,000 VCUs to see how your system scales.
  3. Cost-Effective: Instead of hiring thousands of real users to test a website, VCUs provide an economical way to simulate high traffic. You can emulate thousands, even millions, of users with just a load testing tool.
  4. Consistency: Real users can have varying behaviors, making it hard to reproduce tests with accuracy. VCUs follow the exact script or scenario you've defined, ensuring consistency in every test run.

How are VCUs different from hits or requests?

While VCUs represent individual users interacting with a system, hits or requests are the number of times a user (real or virtual) accesses a resource on that system. For example, when a user visits a webpage, they might generate multiple hits (one for the page itself, others for images, scripts, etc.). So, 100 VCUs might result in hundreds or even thousands of hits, depending on the user journey being simulated.

For JMeter Load Testing

Each Virtual User will execute the test plan in its entirety and completely independently of other test user. If you set a higher number of virtual users, these are used to simulate concurrent connections to your server application.

How many concurrent virtual users do I need?

This is not a straightforward process. Our suggestion is to start small, with 1 virtual user, in order to validate the test you've created and check that the response codes for the requests made are the one desired ones.

Then you can increase the number of Virtual Users gradually to 100, 1000 or 10,000 Virtual Users per second. This will help identify potential bottlenecks in your application.

Virtual Users

Virtual Users Chart

Note: You can slide the Virtual Users setting to visualize the load test you are about to run.

In Conclusion

Understanding the concept of Virtual Concurrent Users is essential for anyone looking to gauge the performance, scalability, and reliability of their websites or APIs. VCUs provide a reliable metric to simulate real-world user load, helping developers and system administrators identify and rectify performance bottlenecks before they impact real users. When selecting a load testing tool, always consider its capability to simulate the desired number of VCUs and how realistically it can mimic user behavior.