What are Virtual Users in Load Testing

What are Virtual Users in Load Testing

The Virtual Users option when creating a new load test is the number of simulated users that hit your application in parallel. Use it to see how the application behaves when that many clients are connected at the same time. The maximum you can set depends on your plan.

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 the maximum of your plan to see how your system scales (see Ramp Up Time and Ramp Up Steps).
  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 of users with just a load testing tool; the exact cap is the Virtual Users limit of your plan.
  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, for example to 100, then 1000, up to the limit of your plan. This will help identify potential bottlenecks in your application. To see at which number of users response times start to climb, read Response Time vs. Virtual Users.

Virtual Users

Virtual Users Chart

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