When you run a load test, LoadRunner generates a load on the system. You can then use LoadRunner’s monitors and graphs to observe the performance of the system under load.
In this lesson you will cover the following topics:
- Controller Run view at a glance
- How do I run a load test scenario?
- How do I monitor the application under load?
- How do I watch a Vuser running in real time?
- Where can I view a summary of Vuser actions?
- How can I increase the load during the test?
- How is the application performing under load?
- Did the application encounter errors?
- How do I know that the scenario has finished running?
- Did the system perform well under load?
The Run tab in Controller is the control center from which the scenario is managed and monitored.
The control for this tab is at the bottom of Controller.
The Run tab (located at the lower section of the window) contains five panes:
|Scenario Groups pane (1)||In the upper-left pane, you can view the status of Vusers in the scenario groups. You use the buttons to the right of this pane to start, stop, and reset the scenario, to view individual Vuser status, and to increase the load on the application during a scenario by manually adding more Vusers.|
|Scenario Status pane (2)||In the upper-right pane, you can view a summary of the load test, including the number of running Vusers and the status of each Vuser action.|
|Available Graphs pane (3)||In the middle-left pane, you can see a list of the LoadRunner graphs. To open a graph, select a graph in the tree, and drag it into the graph viewing area,|
|Graph Display pane (4)||In the middle-right pane, you can customize the display to view between one and eight graphs (View > View Graphs).|
|Graph Legend pane (5)||In the bottom pane, you can view data from the selected graph.|
In this section, you will start the scenario.
Open the Controller Run view.
Click the Run tab at the bottom of Controller.
Notice that there are 8 Vusers in the Down column of the Scenario Groups pane. These are the Vusers you created when you created the scenario.
Since the scenario has not yet run, all other counters remain at zero and all the graphs in the graph viewing area (except Windows Resources) are blank. When you start running the scenario in the next step, the graphs and counters will begin to display information.
Start the scenario.
Click the Start Scenario button or select Scenario > Start to start running the scenario.
If you are repeating the test, you will be prompted to overwrite the existing results file. Click No, because the results of the first load test should be used as baseline results to be compared with subsequent load test results. The Set Results Directory dialog box opens.
Specify a new results folder. Enter a unique and meaningful name for each results set, because you may want to superimpose the results of several scenario runs when you come to analyze the graphs.
You use Controller’s online graphs to view performance data collected by the monitors. You use this information to isolate potential problem areas in your system environment.
Examine the performance graphs.
The Graph Display pane of the Run tab displays the following default graphs:
Running Vusers - Whole Scenario graph (a) Displays the number of Vusers running at a given time. Transaction Response Time - Whole Scenario graph (b)
Shows the amount of time it takes for each transaction to be completed.
Hits per Second - Whole Scenario graph (c)
Displays the number of hits (HTTP requests) made to the Web server by Vusers during each second of the scenario run.
Windows Resources graph (d)
Displays the Windows resources measured during a scenario.
Highlight individual measurements.
- Double-click the Windows Resources graph to enlarge it to fit the entire Graph Display pane. Notice that each measurement appears on a color-coded row in the Graph Legend pane. Each row corresponds to a line in the graph with the same color.
- Select a row to highlight the corresponding line in the graph, and vice versa.
- Double-click the graph again to reduce its size.
View the throughput information.
In the Available Graphs pane, under Web Resources Graphs, select the Throughput graph, and drag it into the Graph Display pane. The Throughput graph measurements are displayed in the Graph Display pane and the Graph Legend pane.
The Throughput graph shows the amount of data (measured in bytes) that the Vusers receive from the server in any given second. You can compare this graph with the Transaction Response Time graph to see how throughput affects transaction performance.
If the throughput scales upward as time progresses and the number of Vusers increases, this indicates that the bandwidth is sufficient. If the graph were to remain relatively flat as the number of Vusers increased, it would be reasonable to conclude that the bandwidth is constraining the volume of data delivered.
When emulating users, you should be able to view the Vusers' actions in real time to make sure they are performing the correct actions. Controller lets you view the actions in real time using the Runtime Viewer.
To visually observe a Vuser’s actions:
In Controller's Run tab, click the Vusers button. The Vusers dialog box opens.
The Status column displays the status of each Vuser. In the example above, you can see that four Vusers are running and four are ready. The Start Vusers action in the scheduler instructed Controller to release two Vusers at a time. As the scenario progresses, Vusers will continue to be added in groups of two at 30-second intervals.
Select a running Vuser in the Vuser list.
Click the Show the selected Vusers button on the Vusers toolbar. The Runtime Viewer opens and displays the actions performed by the selected Vuser. The Runtime Viewer updates as the Vuser proceeds through the steps of the Vuser script.
Click the Hide the selected Vusers button on the Vusers toolbar to close the Runtime Viewer.
To see the progress of an individual Vuser during a running test, you can display a log file that contains a text summary of the Vuser’s actions.
To review a text summary of the Vuser’s actions
- In the Vusers window, select a running Vuser.
Click the Show Vuser Log button on the Vusers toolbar. The Vuser log dialog box opens.
The log contains messages that correspond to the actions of the Vuser. For example, in the window above, the message Virtual User Script started indicates the start of the Vuser's run. Scroll to the bottom of the log and watch as new messages are added for each action performed by the Vuser.
Close the Vuser Log dialog box and the Vusers dialog box.
You can manually add more Vusers during a load test to increase the load on the system.
To increase the load during a load test:
- Make sure that in Controller, the Run tab is displayed
Click the Run/Stop Vusers button. The Run/Stop Vusers dialog box opens displaying the number of Vusers currently assigned to run in the scenario.
In the # column, enter the number of Vusers that you want to add to the group. To run two additional Vusers, replace the number 8 with the number 2, in the # column.
Click Run to add the Vusers.
If some of the original Vusers have not yet been initialized, the Run Initialized and Run New options appear. Select the Run New option.
The two additional Vusers are distributed to the travel_agent group and are run on the localhost load generator. The Scenario Status pane shows that there are now 10 running Vusers.
Note: You may get a warning message that Controller cannot activate additional Vusers. This is because you are using your local machine as a load generator and it has limited memory resources. Generally, use a dedicated machine as a load generator to avoid this issue.
Check the Scenario Status pane [on the Run tab] for a summary of the running scenario. In the Scenario Status pane, you can drill down to see which Vuser actions are causing the application problems. A high number of failed transactions and errors may indicate that the application is not performing as required under load.
View the scenario status.
The header of the Scenario Status pane displays the overall status of the scenario.
View a breakdown of Vuser actions.
If an application starts to fail under heavy load, you are likely to encounter errors and failed transactions. Controller displays error messages in the Output window.
Check for any error or warning messages.
Select View > Show Output. You can sort the message by type, such as Warnings or Errors.
The Output dialog box opens and lists a message text, the total number of messages generated, the Vusers and load generators that generated the error, and the scripts in which the errors occurred.
To view a message in detail, select the message and click Details. The Detailed Message Text box opens, displaying the complete message text.
View log information details.
You can view information about each message, Vuser, script, and load generator associated with an error code by clicking the blue link in the appropriate column.
For example, to locate where in the script an error occurred, drill down the Total Messages column. The Output window displays a list of all messages of the selected error code, including the time, iteration number, and line in the script where the error occurred.
Drill down the Line Number column.
VuGen opens, displaying the line in the script at which the error occurred. You can use this information to identify transactions with slow response times that are causing the application to fail under load.
At the conclusion of a scenario run, the header of the Scenario Status pane shows the Down status. This indicates that all the Vusers in the scenario have finished running.
You can open the Vusers dialog box to see the status of each individual Vuser. The Vuser dialog box displays the number of iterations that each Vuser performed, the number of successful iterations, and the elapsed time.
To see how well the system performed under load, look at the transaction response times and determine whether the response times were within acceptable limits. If the transaction response times increase during the scenario, you need to look for bottlenecks. You will learn more about this in Lesson 7: Analyzing Your Scenario.
Once a problem has been isolated, a corroborative effort involving developers, DBAs, network, and other systems experts is required to fix the problem. After adjustments are made, the load test is repeated to confirm that the adjustments had the desired effect. You repeat this cycle to optimize system performance.
To save the scenario so that you can run it again with the same settings, select File > Save or click the Save button on the toolbar.