Tuesday 8 October 2013

Creating Load test Project in Silk Performer

The easiest method of creating a load test script is to use the SilkPerformer Recorder,  SilkPerformer’s engine for capturing and recording traffic and generating test scripts.

First the SilkPerformer Recorder captures and records the traffic between a client application and the server under test. When recording is complete, the SilkPerformer Recorder automatically generates a test script based on the recorded traffic. Scripts are written in SilkPerformer’s scripting language,

Benchmark Description Language (BDL).

During the recording phase, you define transactions. A transaction is a discrete piece of work that can be assigned to a virtual user in a load test and for which separate time measurements can be made. You should create new transactions only for pieces of work that don’t have dependencies on other pieces of work.

Individual time measurements can be made for any action or series of actions that occur during recording.

Defining a Load Test Project:

The first step in creating the sample load test project is to define the project giving the project a name and specifying the application type under test.

Procedure To define a load test project:

1 Click the Start here button on the SilkPerformer Workflow bar.



2 The Workflow - Outline Project dialog opens.
Enter a project name (e.g., Shopit) in the Project name field.

3 Enter a description for the project in the Project description field (e.g.,Web tutorial with sample application “shopit”).

4 Select Web business transaction (HTML/HTTP) in the Application type field.


Note :If you want to load test a Flash Remoting application, please refer to the Advanced Concepts book, chapter Load Testing Flash Remoting Applications for detailed information.
Note: If you want to load test a WebDAV application (Microsoft Outlook Web Access), simply select WebDAV (MS Outlook Web Access) in the Application type field. The procedure is identical to load testing any other Web business transaction (HTTP).

5 Click OK to create the project based on your settings.

Silk Performer-Over View

The Web Load Testing Tutorial is designed to ease you into the process of load testing with SilkPerformer, and to get you up and running as quickly as possible.It will help you take full advantage of SilkPerformer’s ease of use and to exploit the leading-edge functionality that’s embodied in e-business’s load-testing tool of choice.

 This describes load-testing of Web applications on the protocol level (HTTP/HTML).If you want to load-test applications that heavily rely on AJAX technologies we recommend using browser-driven Web load testing.Browser-driven Web load testing is a solution that uses real Web browsers (Internet Explorer) to generate load, thus leveraging the AJAX logic built into Web browsers to precisely simulate complex AJAX behavior during testing.

SilkPerformer is the industry’s most powerful—yet easiest to use—enterpriseclass load and stress testing tool. Visual script generation techniques and the ability to test multiple application environments with thousands of concurrent users allow you to thoroughly test your enterprise applications’ reliability,performance, and scalability before they’re deployed—regardless of their size and complexity. Powerful root cause analysis tools and management reports help you isolate problems and make quick decisions—thereby minimizing test cycles and accelerating your time to market.
Benefits: Ensure the scalability, performance, and reliability of your enterprise applications

SilkPerformer ensures the quality of your enterprise applications by measuring their performance from the end-user perspective, as well as internally, in a variety of workload scenarios and dynamic load conditions.

Test remote components early in the development cycle Dramatically reduce the cost of bugs in your multi-tier enterprise application by testing the functionality, interoperability, and performance of remote components early in the development cycle—even before client applications have been built. You can rapidly generate test drivers for Web services, .NET remoting objects, EJB’s and Java RMI objects by exploring them via a point & click interface. Alternately, you can reuse unit test drivers written by developers for concurrency tests or you can build new test cases directly in Java and other .NET languages, such as C# and VB.NET, using SilkPerformer’s Visual Studio .NET Add-In.

Pinpoint problems easily for quick resolution

SilkPerformer’s unrivaled TrueLogTM technology for HTML, XML, SQL, TCP/  IP, and UDP based protocol data provides full visual root-cause analysis from the end-user perspective. TrueLogs visually recreate the data that users provide and receive during load tests—for HTML pages this includes all embedded

objects—enabling you to visually analyze the behavior of your application as errors occur during load tests. In addition detailed response timer statistics help you uncover the root causes of missed Service Level Agreements before your application goes live.Reusing projects SilkPerformer’s extended workflow simplifies and deepens its integration with SilkCentral Test Manager.

By clicking SilkPerformer’s new Reuse Project button, test projects can be uploaded to and reused by Test Manager (for test automation).

Calculate Number of Vusers in Load Runner

The business requirement: The website will be subject to 100.000 users per hour.
Analyzing real user behavior it is found that a typical user spends 15 minutes on the site, and browses 10 pages on average.

This means the implemented user scenario will contains 10 page-requests and each virtual user will run for 15 minutes.
To calculate the necessary number of users, we use the following basic formula:

Number of required VUsers = Required requests per seconds * User scenario length (sec)

Note: The requests-per-second-based approach (or in our case Transactions-per-Second, as we assume 1 request=1 transaction) is an adequate approach, as Load runner also uses Transactions per second when displaying metrics data.

Using the above requirements the number of virtual users can be calculated using the following formula:

No. of required VUsers = (number of site users per hour * requests per user / 
3600) * user scenario length (sec)

Using the above formula: 
Number of site users per hour := 100000 users (100k) 
 Requests per user := 10 reqs
 User scenario length (sec) := 15 minutes * 60 seconds = 900 sec required transactions per hour (TPH) := number of site users per hour * requests per user required 
Transactions per seconds = required transactions per hour (TPH)/(60 minutes * 60 seconds) 

number of required VUsers := number of site users per hour * requests per user /
3600 * user scenario length (sec)
number of required VUsers = ((100000 * 10)/3600 )* 900 = 250000 Vusers
250,000 virtual users are required to create the appropriate load.
Well. This calculation is fine, but not very efficient
Notice, that in our implementation each virtual user will run for 15 minutes, but they are idle for most of the time (as each user performs 10 requests altogether).

Here is a better solution: We know that each request is likely to be quick (let’s say quicker than 1 second).

 So we compact the user scenario: the script can perform the scenario in 15 seconds instead of 15 minutes. 

The think times can also be reduced from 1.5 minutes to about 1 seconds accordingly.
After recalculating the number of required virtual users, we find that we need only 4166 virtual users to simulate the required load. This is a significant difference!

In practice scripts are not created with lengthy think times. A 1 second think time is usually the pragmatical approach. The recorded think times of the script can be scaled down or can be limited to a configured length. The Think Time run time settings’ “User random percentage of recorded think time” and “Limit think time to” options control this.





After the script is created the average length of script execution should be determined. This can be done with manual execution in VUGen. . The measured length can be substituted into the formula to determine the required number of virtual users.

Silk Performer Case Study- Silk Performer Interview Question

1) Clear the cookies on the browser
2) Create a shopIt Application script
a. With timers
i. Join The Experience
ii. Product Search
iii. Check Out
b. Data drive the test case with joined users
c. With Verification points

i. Welcome page title
ii. Add Verification for user name with existing parameter
iii. Add Verifications for Alphabets on the page

3) Create 2 profiles for
a. Bandwidth 128 Kbps with IE 6.0
b. Bandwidth High and Netscape 7.0

4) Add user types to the script with 2 profiles

5) Baseline the test and run

6) Add the threshold for custom timers with Min 4 times and Max 5 times

7) Add atleast 2 agents

8) Add the Performance Monitor workspace with local machine CPU, memory and Network Interface counters

9) Create a workload for 8 users in Increasing workload model
a. Start users 2
b. Increase by 1 user every 20 Sec
c. Simulation time 5 min
d. Warmup time 30 Sec
e. Measurement time 4:30 Sec

10) Run the load test

11) Write Analysi

Vuser Calculation In LoadRunner

How to calculate number of virtual users (VUsers) for load/stress testing? What should be the concurrent virtual users to load?

 What should be the peak load?

25, 100, 500, 1000. We cannot give number of VUsers blindly which will not return intuitive result for analysis.

The main purpose of VUsers is to simulate the live environment. It is very tricky but easy to obtain number of VUsers required for the load/stress testing. Universal formula to calculate the arriving rate to the system is Little’s Law.

N = Z * (R + T)

where 

N – number of VUsers,
Z – Transactions per Second (TPS)
R – Response Time in seconds
T – Think Time in seconds

If you get the following data from the stakeholders i.e. TPS, Response Time and Think Time, number of VUsers can be calculated easily.

E.g. 

TPS is 100, R is 3 sec and T is 2 sec then N will be

N = 100 * (3+2)
= 100 * 5
= 500

Peak load will be 500 VUsers.