Problem:
How to get the active VUser count at any point in time in LoadRunner?
Explanation:
LoadRunner executes the script in the controller or Performance Center and generates the required number of Virtual Users (VUsers). But not all the VUsers are active full-time, especially when the login and logout part is in the Action(). If you want to know how many VUsers are active at a particular time, then follow the steps below.
Solution:
Prerequisite:
As a prerequisite, you need to first identify how many TCP/IP connections are established by one VUser during the test. For this purpose:
- Comment out the “Logout” transaction of the VUGen script
- Run the test for a few minutes. The test duration should be long enough to complete at least one iteration
- Collate the result
- Open the result file in the LoadRunner Analysis Tool
- Open the “Connections” graph
Graphs->Add New Item->Add New Graph->Web Resources->Connections - Note down the number of connections established during the one-user test (No. of Connections = 6; Refer the below screenshot)

Actual Test:
- Run the actual test with a full load
- Collate the result after test completion
- Open the result file in the LoadRunner Analysis Tool
- Open the “Connections” graph
Graphs->Add New Item->Add New Graph->Web Resources->Connections - Hover the mouse on the graph and get the “Number of Connections” value. Refer to the screenshot below, where at 00:11:00, the number of connections is 36.000. Note down this value.

Calculation of the Number of Active VUsers at a particular time:
Number of Active VUsers = Total Connections at that time / Connection made by one user
=> Number of Active VUsers at 00:11:00 = 36 / 6
=> Number of Active VUsers at 00:11:00 = 6
Hence, 6 VUsers are active at 00:11:00. Similarly, you can calculate the Active VUser count at a different time in the LoadRunner test.
You may be interested:
- Performance Testing Tutorial
- Performance Engineering Tutorial
- Apache JMeter Tutorial
- Neotys NeoLoad Tutorial