Calculate Vusers for load testing

In this How to Calculate Vusers for load testing,you will learn calculate virtual users for your load testing or stress testing in order to achieve results which mimics real world.

What is load testing?


Load testing is describes how your application behaves for a given load at peak hours as well as how much time it will take to provide response for a particular request to verify your application speed,performance of the application.Load testing can be done with JMeter(Learn JMeter) or any other open source tool but in open source tool you can't run with more VUsers to check behavior of your applications.

Calculate Vusers for load testing


You can calculate number of vusers required for load testing with a basic formula as below

No of Vusers = TPS * (Response Time + Think Time)
TPS – Transactions per Second

Now here you can't simply provide 50,70,100,250,500 etc VUsers to test load on your applications,above requirements are given by the clients in below formats,then you have to calculate based on client requirements.

Business NFR:


Business NFR contains business requirements about application under test,in order to verify application performance with load testing.

Details:


Details will contain test scenarios.

Example : Verify Bank account details.

Business Rules:


Business rules contains actual results as per 3 months old data or 6 months old data with the help of analytic,Business Remarks gives below details about application(AUT).

Number of Transactions per Seconds : 600
Average Response Time : 3 sec
Think Time : 3 sec

So now it is easy to calculate number of virtual users required for a test scenario as below
Number of Virtual Users = 200*(2+1)
Number Of Virtual Users = 200*3
Number of Virtual Users = 600

So required virtual users for your test scenario is 600 VUsers for peak loads,some time users will vary may be less or more but in peak time users will increase suppose example as Festival time most of the companies running promotions on their applications to attract new users at that time number of users automatically increase,this is called peak load time.

New Features in LoadRunner 12.53

HP Loadrunner 12.53 version is released and below are the New Features in LoadRunner 12.53 are added,please find the details,also read LoadRunner tutorials for good knowledge.LoadRunner releases 11.01,11.02 to 11.50.12.02,12.50 and 12.53.

New Features in LoadRunner 12.53


Git integration in VuGen
Web - HTTP/HTML and Mobile Application - HTTP/HTML protocol unification
Linux load generator improvements
New PCoIP (remote access) protocol
Enhanced SAPUI5 recording in TruClient
REST step-builder editor in VuGen
JSON manipulation APIs
HTTP Video Streaming (HTML5, HLS) support
HTTP/2 support
Enhancements to Java-based protocols
64-bit replay support in various Java protocols and C Vuser protocol
Added in 12.53 Patch 2: Support for NV Insights
New Supported Technologies and Platforms
VuGen Enhancements
TruClient Enhancements
Virtual Table Server (VTS) Enhancements
General Protocol Enhancements
Controller Enhancements
Analysis Enhancements
Help Center Enhancements
Security Enhancements
Installation Enhancements
Integrations with the latest HPE product versions

New Technologies


Windows 10
Microsoft Edge browser
Visual Studio 2013 add-in
Visual Studio 2015 add-in
Upgraded Eclipse IDE add-in
SUSE Linux Enterprise Server 12
Red Hat Enterprise Linux 7.2
hLinux.

TruClient Enhancements


Loadrunner 12.50 supports Chromium 46 ,Firefox 40.0.3 and Internet Explorer 10 and 11 ,9 is not supported.
New End Events,Automatic End Event in Browser.
Enhancements Automatic Object Identification.
Enhancements in Control actions during recording the script.

Loadrunner 12.50 enhanced in some of the Protocols those are Citrix,C Vuser , Flex ,FTP , Java Protocol,Oracle 2-Tier,SAPGUI,Web – HTTP/HTML and last WebServices.Enhanced Analysis web GUI and provided good look in HTML reports.Loadrunner 12.50 integrated with some of the following products for better performance testing ,those are

Service Virtualization: Support for Windows 10
Diagnostics
Network Virtualization
Unified Functional Testing
Application Lifecycle Management
Performance Center
Business Process Monitor
Jenkins

Please see the complete list of enhancements in HP Site.

lr_xml_find function example

In this lr_xml_find function example you will learn how to use lr_xml_find in LoadRunner Vugen script.The lr_xml_find function verifies that whether XML values return by the server which will contains a specified query or not,simply lr_xml_find verifies the XML values with the help of XML Query.


lr_xml_find function example,Please read All REAL TIME EXAMPLES OF LOADRUNNER HERE


Loadrunner Runtime Settings

Most important settings in VuGen is Loarunner Runtime Settings which is very useful in preparing the scenarios and for vugen scripting execution.While running the script these Runtime settings should be proper in order to execute the script as requirement for examples

Loadrunner Runtime Settings

1.Running the script for Multiple users.
2.Running the script with think time.
3.Running the script with / out proxy set up.
4.Running the script with extended log to see in details response etc.

Runtime Settings has below lists

In General there are 6 components those are

1.Run Logic :

Run Logic configure the number of iterations to repeat the same action by each Vuser.
>Main : This iterations repeats the user actions with the given number of times.Here Iterations are applicable only for action methods where scripting is prepared.
>Block: It defines the Block iterations to repeat each user action with different number of times.Please find the screen shot below.

loadrunner runtime settings

2.Pacing:

Pacing in Runtime settings is a virtual user waiting time between the iteration executions as below

1.As soon as the previous iteration ends
2.After the previous iteration ends – with a "fixed/random" delay of seconds.
3.At "fixed/random" intervals, every – seconds.Please see below screen shot for clear idea.

3.Log:

In order to check the execution log for response data we will use Log menu and it captures the behavior of the script execution.

Log menu has below sub Options:
Send Messages only when an error occurs.
Load runner will display messages in log only when error occurs in script execution.
Always Send Messages.
Always send messages option has two options those are
A.Standard Log :Standard log display default log for script execution.
B.Extended Log:Extended Log display the script execution as per below selected option those are

1.Parameter Substitution :

Log displays with each parameter substitution ,it is useful when we are doing parameterization testing.It will show each script response,for each parameter substitution like for 50 users it displays all 50 iteration script response in log in details.

2.Data returned by server : It displays only the data which is return by the server to Vusers ,sometime it display server connections also.
3.Advanced trace : It display all the vuser messages and function calls in case we are using any functions in scripts like examples

1.lr_start_transaction("User_Login")
2.lr_end_transaction("User_Login",LR_AUTO)
3.lr_error_message()
4.lr_output_message("User Login is successful")

Please see below screenshot.

loadrunner runtime settins


4.Think Time:

Think Time defines as It is a user waiting time between the transaction executions in the script.
For example
1.User login to application and waits some time to display my account screen.
2.Compose emails and verifying the message body with some time before sending.
3.Online Transactions.

Think Time has below options

a.Ignore Think Time
b.Replay Think Time

1.As Recorded
2.Multiply recorded think time by: --
3.Use random percentage of recorder think time:Min: -- %,Max: -- %
4.Limit think time to – seconds. Please see below screenshot.

Most of the time we will choose Replay Think Time As Recorded option in Runtime Settings foe script.

5.Additional attributes:

It is useful in reading value from run-time settings and which is helpful in pass value into script using run time settings.Declare argument name and value here and we can use those values into script and save the value into string using lr_save_string() and lr_get_attrib_string() functions.

6.Miscellaneous:

In this menu we are having 7 options those are

Error Handling:

1.Continue On Error : as name indicates script will execute in case error occurs while execution.
2.Fail open transactions on lr_error_message : It will fail all open transactions once the function lr_error_message is called by the user in the transactions.
3.Generate snapshot on error:It will generate snapshot of error while script execution at Runtime and display in snapshot menu.Always we has to check/select Generate Snapshot on error to capture error pages at Runtime.

Multi Threading:

1.Run Vuser as a process:
a.It is useful in running each vuser as a complete process.
b.For each Vuser it creates a separate driver program in the load generator.
c.It occupies more system resources in load generator as it created a separate driver program. (For each Vuser mdrv.exe)

2.Run Vuser as a thread

a.For all the Vusers, it creates a single driver program in the load generator.
b.Occupies less system resources as it is using a single driver program for all the Vusers (mdrv.exe)

Automatic Transaction:

1.Defines each action as a transaction (Always disable this)
2.Defines each step as a transaction.

7.Network:

The name indicates setting of Network speed as use maximum Bandwidth , Use bandwidth which is starting from kbps,Use custom bandwidth where user can provide specified band width speed for script execution.

8.Browser

Browser Emulation:In Browser Emulation can do all the browser level enhancements.

1.Simulate Browser Cache
2.Simulate a new user on each iteration :Whenever we not require to reuse the browser cache, Enable Simulate a new user on each iteration and by clearing the existing cache on each iteration.

Browser Properties are

1.Simulate Browser Cache
2.Download non-HTML Resources
3.Simulate a new user on each iteration

9.Internet Protocol

Internet protocol has below options,

Proxy : While execution of some scripts it requires proper proxy setting for example outside of the network applications in corporate offices.For outside network applications, it is mandatory to have proxy settings to access the links.At that time we will go for proxy settings and proxy has below options

1.No Proxy(Direct Connection to the Internet)
2.Obtain the proxy settings from default browser i.e IE,Chrome etc
3.Use Custom Proxy :Here we can provide our custom proxy details like Port Number and Ip address(Host address.)
1.For the LAN (Load Generators and Servers are residing on the same network) based performance testing, it is recommended to use No Proxy.
2.For WAN based OR Internet-based (Load Generators and Servers are residing on different network) Performance Testing, it is recommended to use Obtain the proxy settings from the default browser.

10.Preferences:

Preferences in LoadRunner provides details about

1.Enable Image and Text Check
2.Generate Web Performance Report Generation which contains Hits per second, Page per second and Response bytes per second.
3.Advanced Download Files Content Check

In Case like this article please provide your valuable comments and suggestions.Thank you for reading.