Tuesday 30 July 2013

Fundamental laws of Performance Testing?

 Little's Law:

Little's law is quite simple and intuitively appealing.

The law states that the average number of customers in a system (over some time interval), N, is equal to their average arrival rate, X, multiplied by their average time in the system, R.

N = X . R (or) for easy remembrance use L = A . W

This law is very important to check whether the load testing tool is not a bottleneck.
For Example, in a shop , if there are always 2 customers available at the counter queue , wherein the customers are entering the shop at the rate of 4 per second , then time taken for the customers to leave from the shop can be calculated as

N = X. R
R = 2/4 = 0.5 seconds

A Simple example of how to use this law to know how many virtual users licenses are required:

Web system that has peak user load per hour = 2000 users
Expected Response time per transaction = 4 seconds
The peak page hits/sec = 80 hits/sec

For carrying out Performance tests for the above web system, we need to calculate how many number of Virtual user licenses we need to purchase.

N = X . R
N = 80 . 4 = 320

Therefore 320 virtual user licenses are enough to carry out the Load Test.



Fundemental law of performaance testing:

PEA was formed by professionals who have had the opportunity to lead assignments that brought about several radical changes by bridging the gap between theory and practice in PE.

Fundamental Laws:

1. Utilization law
2. Little's law
3. Response Time law
4. Forced Flow law
5. Service Demand law

DataBase Monitoring

Useful Info about Oracle STATSPACK Analysis
From Perfmon (Windows platform) / SAR , vmstat & other commands (UNIX platforms), you can get the insight of the server resource utilization information. But in case of the database servers, it’s very important that you need to know what is happening in the database server.

Oracle (versions later than 8i) comes with a performance diagnosis tool called STATSPACK. (In case of SQL server, try using SQL Profiler tool).

Statspack is an Oracle performance diagnosis tool (perfstat) available from Oracle 8i. It has the features of Oracle’s utlbstat.sql and utlestat.sql utilities (used in previous versions of Oracle). It has about 25 tables which help to maintain the performance information of the server.

There are good urls available in the net which details the working of Statspack. Some of them include

http://www.pafumi.net/Statspack_Analysis.html
http://www.dba-oracle.com/art_statspack.htm
http://www.akadia.com/services/ora_statspack_survival_guide.html
http://jonathanlewis.wordpress.com/2006/11/29/analysing-statspack-pt1/

There are certain things which a performance tester needs to know about the database server. I feel it’s very much required that a performance tester knows what the various terminologies (atleast) though DBA’s knowledge is not possible. From my experience, I strongly feel that Statspack analysis helps in figuring out whether something is really going wrong in the database. It would help the performance tester to answer the question - Is it worth to spend some time in tuning my database to improve system performance?

At a high-level, it works like this. Before running the test, take a snapshot (by running a simple command) of the database (snapshot collects the current value of all possible database statistics and stores it in the database table. After running the test, take another snapshot of the database and now compare these 2 snapshots (by running a simple command) and get the text report. By analysing this report, you can identify how the database was performing between these 2 snapshots (i.e... during the test run, which is what we are interested in looking at).

I am sure that if we are aware of following terms, it will be easy to figure out certain major database issues. Ofcourse, Statspack analysis performed by DBA is recommended, this is not practically achieved in many projects. In such cases, being a performance tester, you can atleast visualize bottlenecks in the database without DBA’s help.

1. Parses (hard parses vs. soft parses)
2. Transactions per second
3. User calls
4. % Library Hit & % Buffer Hit
5. Top Wait Events
6. Specific Wait events related to Indexing issues/ high table scans
7. Rollbacks per transaction
8. Top 10 SQLs sorted by Query executions, Buffer gets (CPU time) and Parse Calls.

There are lot of Statspack analysis tools available which will analyse the Statspack report and provide the analysis report. But you need to atleast know the above stated information in order to understand the report better. Try using online tools like oraperf.com or statspackanalyzer.com. If you are looking at deep insights of the database server to provide recommendations to the development team, try using tools like spAnalyzer, Wise, etc. (http://www.spviewer.com/index.html , http://www.wise-oracle.com )

Code & Application server related performance issues in J2EE

In J2EE environment, there are some common Code related or Application server related problems. It include :

Code related problems :

1. Slow Methods
a. Consistently Slow Methods
b. Intermittently Slow Methods
2. Synchronization Problems
3. Memory Problems
4. Coding Practices, such as using exceptions as a means to transfer control in the applications

Application server configuration problems :
1. JDBC Connection Pool size
2. JVM Heap size
3. Thread Pool size

Bottlenecks in performance Testing

Network Bottleneck Symptoms:

The simplest way to measure effective bandwidth is to determine the rate at which your server sends and receives data. Network bandwidth availability is a function of the organization's network infrastructure. Network capacity is a function of the network cards and interfaces configured on the servers.

Network Interface: Bytes Total/sec : To determine if your network connection is creating a bottleneck, compare the Network Interface: Bytes Total/sec counter to the total bandwidth of your network adapter card. To allow headroom for spikes in traffic, you should usually be using no more than 50 percent of capacity. If this number is very close to the capacity of the connection, and processor and memory use are moderate, then the connection may well be a problem.

Web Service: Maximum Connections and Web Service: Total Connection Attempts : If you are running other services on the computer that also use the network connection, you should monitor the Web Service: Maximum Connections and Web Service: Total Connection Attempts counters to see if your Web server can use as much of the connection as it needs. Remember to compare these numbers to memory and processor usage figures so that you can be sure that the connection is the problem, not one of the other components.

To determine the throughput and current activity on a server's network cards, you can check the following counters:

· Network\Bytes Received/sec
· Network\Bytes Sent/sec
· Network\Bytes Total/sec
· Network Current Bandwidth

If the total bytes per second value is more than 50 percent of the total capacity under average load conditions, your server might have problems under peak load conditions. You might want to ensure that operations that take a lot of network bandwidth, such as network backups, are performed on a separate interface card. Keep in mind that you should compare these values in conjunction with Physical Disk\% Disk Time and Processor\% Processor Time. If the disk time and processor time values are low but the network values are very high, there might be a capacity problem. Solve the problem by optimizing the network card settings or by adding an additional network card. Remember, planning is everything—it isn't always as simply as inserting a card and plugging it into the network.

Disk Bottleneck Symptoms:

A bottleneck from a disk can significantly impact response time for applications running on your system.
Physical Disk (instance)\Disk Transfers/sec counter for each physical disk and if it goes above 25 disk I/Os per second then you've got poor response time for your disk.
By tracking Physical Disk(instance)\% Idle Time, which measures the percent time that your hard disk is idle during the measurement interval, and if you see this counter fall below 20% then you've likely got read/write requests queuing up for your disk which is unable to service these requests in a timely fashion. In this case it's time to upgrade your hardware to use faster disks or scale out your application to better handle the load.

Look for the Physical Disk (instance)\Average Disk Queue length &Physical Disk (instance)\Current Disk Queue length parameters to get more details on the queued up requests.

CPU Bottleneck Symptoms:
Symptoms for CPU bottlenecks include the following :

The Processor(_Total)\% Processor Time(measures the total utilization of your processor by all running processes) will be high. If the server typically runs at around 70% or 80% processor utilization then this is normally a good sign and means your machine is handling its load effectively and not under utilized. Average processor utilization of around 20% or 30% on the other hand suggests that your machine is under utilized and may be a good candidate for server consolidation using Virtual Server or VMWare.

Further to breakdown this %processor Time , monitor the counters -Processor(_Total)\% Privileged Time and Processor(_Total)\% User Time, which respectively show processor utilization for kernel- and user-mode processes on your machine. If kernel mode utilization is high, your machine is likely underpowered as it's too busy handling basic OS housekeeping functions to be able to effectively run other applications. And if user mode utilization is high, it may be you have your server running too many specific roles and you should either beef hardware up by adding another processor or migrate an application or role to another box.

The System\Processor Queue Length(indication of how many threads are waiting for execution) consistently greater than 2 or more for a single processor CPU is a clear indication of processor bottleneck . Also look at other counters like ASP\Requests Queued or ASP.NET\Requests Queued as well.

Symptoms for Application & Web Server Bottlenecks


Symptoms for Application server bottleneck
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Increased 'Server Time' breakup
2. One or more page components of transaction takes more time where in the DB query is having less execution time.
3. The Static files are having less response time whereas the dynamic contents (servlets,jsp,etc) takes more time.
4. Network delay is negligible.
5. Home Page gets displayed in few seconds even during the stress period(as it is fetched from the web server).
6. Hits / sec & Throughput remains less.
7. If the CPU/ Memory/Disk of the App server has any bottleneck symptoms.
8. If the HTTP / HTTPS connections established doesn’t increase proportionally with the load.
9. If the new connections established is very higher & the reused connections are very less.

Symptoms for Web server bottleneck
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Increased 'Server Time' breakup
2. One or more page components of transaction takes more time where in the DB query is having less execution time.
3. The static files are having high response time than the dynamic contents (servlets,jsp,etc).
4. Network delay is negligible.
5. Home Page takes more time for display.
6. Hits /sec in the web server is very less.
7. If the CPU/ Memory/Disk of the web server has any bottleneck symptoms.

Hardware Malfunctioning Symptoms:


System\Context Switches/sec (measures how frequently the processor has to switch from user- to kernel-mode to handle a request from a thread running in user mode.). If this counter suddenly starts increasing however, it may be an indicating of a malfunctioning device, especially if you are seeing a similar jump in the Processor(_Total)\Interrupts/sec counter on your machine.
You may also want to check Processor(_Total)\% Privileged TimeCounter and see if this counter shows a similar unexplained increase, as this may indicate problems with a device driver that is causing an additional hit on kernel mode processor utilization.
If Processor(_Total)\Interrupts/sec does not correlate well withSystem\Context Switches/sec however, your sudden jump in context switches may instead mean that your application is hitting its scalability limit on your particular machine and you may need to scale out your application (for example by clustering) or possibly redesign how it handles user mode requests. In any case, it's a good idea to monitor System\Context Switches/sec over a period of time to establish a baseline for this counter, and once you've done this then create a perfmon alert that will trigger when this counter deviates significantly from its observed mean value.

Memory Bottleneck Symptoms:


When it comes to the System memory , there are 3 things to monitor :

1.Monitor Cache (Hits/Misses),
2.Monitor Memory (Memory Available/sec, Process/Working Set),
3.Monitor Paging (Pages Read/Sec, Pages Input/Sec, Page Faults/Sec, % Disk Processing)

Memory\Available Bytes, if this counter is greater than 10% of the actual RAM in your machine then you probably have more than enough RAM and don't need to worry.

The Memory\Pages/sec counter indicates the number of paging operations to disk during the measuring interval, and this is the primary counter to watch for indication of possible insufficient RAM to meet your server's needs.

You can monitor Process(instance)\Working Set for each process instance to determine which process is consuming larger and larger amounts of RAM. Process(instance)\Working Set measures the size of the working set for each process, which indicates the number of allocated pages the process can address without generating a page fault. A related counter isMemory\Cache Bytes, which measures the working set for the system i.e. the number of allocated pages kernel threads can address without generating a page fault.
Finally, another corroborating indicator of insufficient RAM isMemory\Transition Faults/sec, which measures how often recently trimmed page on the standby list are re-referenced. If this counter slowly starts to rise over time then it could also indicating you're reaching a point where you no longer have enough RAM for your server to function well.

What is the difference between Simultaneous & Concurrent users ?

These are the 2 terms which is often used in Performance Testing.

Simultaneous users are the users who have a valid session in the server. Each of the users would be performing different actions like one doing login , other viewing the reports, etc.

Concurrent users are the users who have a valid session in the server & they are performing the same operation at any point of time. All the concurrent users would perform login, reports download, etc at the same point of time.

Hence for a web site, the number of simultaneous users would be always greater than the concurrent users.For example , a banking web site has the workload of about 30000 simultaneous users & 5000 concurrent users.

Knowing the correct figures of simultaneous & concurrent users is very vital in order to perform performance testing of an application.

Detection of Memory Leaks in load runner visual explanation

It needs perform testing of Web server to discover memory leaks.

The solution:
Create LoadRunner VuGen script for your application (Web server in my script)
Let's suppose, we have done



Create LoadRunner Controller scenario for your application using the VuGen scripts.


The next step is to add measurement monitors which are quantitative indicators of resources being monitored (for example, memory usage, CPU usage, handle and thread count, and so on).

For that, on "Run" tab in the LoadRunner Controller, drag "Windows Resources" item from the "Available Graphs" tree and drop it to graphs area.
See the screenshot:



Then right-click on the just added graph ("Windows Resources") and select "Add Measurements" from the pop-up menu."Windows Resources" dialog will be shown:


The following actions are easy. I will add the name of server where the application (Web server in my case) will be run. This server can be a remote one. In this case, you have to make sure that LoadRunner will have an access to get info from the remote computer. Usually, I provide administrator rights for user which executes LR scripts.

After that I select counters I want to measure during the load testing:




So, "Windows Resources" dialog looks like


I selected the following counters:

% User Time for two processes (RService & tomcat5) and the whole system (_Total)
Available bytes in the system
Handle counts
Thread counts

Working SetsAlso you may wish to add "Private Bytes" counter. Description for each counter is available on "Windows Resources" dialog. Obviously that the set of counters depends on the requirements and software to be tested.

Pay attention... If you select the "Windows Resources" graph, the list of counters will be shown in the lower part of the LoadRunner Controller:




We have to run the scenario against a number of concurrent users (I user 30 users) and observe the graph displaying info on memory, CPU, handles and so on...
I will show the result graph after 4 hrs of execution:






Pay attention to the yellow dotted line (memory usage of "RService" process) and the brown dotted line (habdle count counsumed by "RService" process) trends. They grow constantly during ~ 4.5 hours. I marked them out with red lines.
So, this graph provides proofs that the application, I tested, contains memory leaks in the "RService" process.

Several words about useful tricks and hints, connected to measurements ans graphs:

It is possible to export graphs to HTML from the LR. For that, right-click on the graph and select "Export to HTML...". It will generate HTML report containing the graph and a legenda for it.

I recommend to set the range of time to be shown on the graph, to "Relative to scenario start". To perform this, right-click on the graph and select "Configure...". That allow to display statistics for the whole execution, but the latest N minutes.

Sometimes, it is convenient to show more detailed graph. For that, double click on the graph - one big graph will be shown. To revert, double-click again. Also, you can change the number of graphs displayed - open menu View/View Graphs and set the required number.


So, now Dev team has to fix the problem in the "RService" process.. The last graph shows the results of load testing perfomed on the fixed application:



No any memory leaks found during 10 hrs.

Vugen Not Recording — Internet Explorer (iexplore.exe) “Hangs” when launched during recording

Vugen Not Recording — Internet Explorer (iexplore.exe) "Hangs" when launched during recording
When recording WEB (HTTP/HTML) script Vugen launches iexplore.exe but Internet Explorer window is not displayed.

This may occur due to COM object permissions.
Change the following Recording Options setting:
"Recording Options" -> General ->"Script": UN-CHECK "Track processes created as COM local servers"
Then record the WEB (HTTP/HTML) script.

Can QTP and LR be installed on the same machine

Can QTP and LR be installed on the same machine

QTP and LR share some files. Therefore, if QTP is installed and then LR is installed, this will cause problems. QTP and LR can be installed on the same machine, but special attention has to be given to the install squence.

LR needs to be installed first, then QTP can be installed.

If you plan to execute QTP scripts, QTP should be installed on Load Generator computer.

How Unique with Each iteration and Abort Vusers works in Parameter file

When a File parameter is unique, LoadRunner will divide the data evenly into blocks and assign each block to a virtual user when it starts running. Each vuser will use the data in their assigned block sequentially.

This means that the used values aren’t all at the start of the file; they appear in chunks, spread evenly throughout the file (unless your scenario has a single virtual user).

Size of block depends on the "Automatically allocate block size" and "Allocate ____values for each Vusers."If we select first "Automatically allocate block size" it allocates data in 1 block= no of iterations.

Load Runner with VMWare

HP recommendation about LoadRunner on VMWare

LoadRunner 11 supports VMware ESX 4.0 on Windows XP, 2003 and Vista.
It is not recommended to run Load Generator for load testing purposes on Virtual Environment, however it shouldn’t be a problem.

Don’t need to install any patches to be able to run it on VM but always recommend installing the latest patches (currently patch 4).

How to download LoadRunner tool through HP site

This article is about to download LoadRunner11.0 from HP site when you have proper SAID

To download the installation you go to the following link:
http://support.openview.hp.com/ (make sure u are logged in)

1. After you load the link go to >>Downloads
2. >>Software updates window button
3. My Updates
4. To make sure you see the same options like me we will go the other way around and enter your SAID directly
5. Fill the checkbox where you accept the terms and conditions
6. Click View Available Products >>
7. Under Performance Center you can find HP LoadRunner 11.00 Eng SW E-Mediacheck the box and click the Get Software button on the bottom of the page.
8. Now you should see it on top of the table so under Deliverables click again Get Software.
9. Now you can see in the second window one .zip and one .z01 of LoadRunner.
10. Pick one of them and Download it (Directly or via HP Download Manager)

Best practices in performance testing

Here are some of the most common things projects do that make performance testing difficult or less productive…

Stick to the requirements, even when they don’t make sense
You should know by now that projects aren’t very good at defining their non-functional requirements. This means that it is necessary to use a certain amount of common sense when applying them to the performance test results. As an example, imagine that a response time requirement specified that average response times for login should be less than 5 seconds. During performance testing, it is found that 90% of login transactions take 1 second, but 10% take 40 seconds. On average, the response time for the login transaction is 4.9 seconds, so someone who interprets requirements very strictly would consider the response time acceptable, but anyone with good critical thinking skills would see that something is wrong and think to get the intent behind the requirement clarified.

Use the wrong people to do your Performance Testing
A very common mistake is to assume that someone who does functional test automation is necessarily suited to performance testing because they know how to use another tool that is made by the same company. Another mistake is to assume that just because the project has purchased the very best tool money can buy, and it is very easy to use, this will compensate for testers who don’t know anything about performance testing (“fools with tools”). Performance testing is a highly technical activity, and is not a suitable job for anyone who cannot write code, and who does not understand how the system under test fits together.

Don’t provide enough technical support to investigate and fix problems
A good way to ensure that it takes a long time to fix defects is to fail to provide someone who is capable of fixing the problem, or to provide someone who is too busy to work on the problem. Load and performance-related defects are difficult problems, which are not suitable to assign to a junior developer. It is best to make code-related performance problems the responsibility of a single senior developer, so that they have a chance to focus, and are not distracted by all the other (much easier to fix) problems in the buglist.

Don’t let performance testers do any investigation themselves

Having a rigidly enforced line between testers (who find problems), and a technical team (who determine the root cause of a problem, and fix it) doesn’t work so well with performance testing. Performance testers find problems that are impossible for other teams to reproduce themselves (and it’s pretty hard to fix a problem you can’t reproduce). This means that performance testers and technical teams need to work together to determine the root cause of problems. Performance testers can do a lot of this by themselves if they have access to the right information. This means setting up infrastructure monitoring, and providing logons to servers in the test environment and access to any application logs.

Wishful extrapolation

Imagine that the test system is two 2-CPU servers, and performance testing shows that it can handle 250 orders per hour. The Production system is two 8-CPU servers, so it should be able to handle 1000 orders per hour, right? Well, not necessarily; this assumes that the system scales linearly, and that CPU is the only bottleneck. Both are bad assumptions. It is best to test in a Production-like environment, or to have a very solid (experimentally proven) knowledge of how your system scales.


Hide problems

One of the main reasons for software testing is so that the Business stakeholders can make an informed decision about whether a new system is ready to “go live”. Often performance testers are put under pressure to downplay the severity or likelihood of any problems in their Test Summary Report. This is usually due to a conflict of interest; perhaps performance testing is the responsibility of the vendor (who is keen to hit a payment milestone), or the maybe the project manager is rewarded for hitting a go-live date more than for deploying a stable system. In either case, it is a bad outcome for the Business.

Following are some of these performance stats and business losses examples.
  • In September 2010, Virgin Blue's airline's check-in and online booking systems went down. Virgin Blue suffered a hardware failure, on September 26, and subsequent outage of the airline's internet booking, reservations, check-in and boarding systems. The outage severely interrupted the Virgin Blue business for a period of 11 days, affecting around 50,000 passengers and 400 flights, and was restored to normal on October 6. .There is a loss of $20million.
  • Average user clicks away after 8 seconds of delay
  • $45 billion business revenue loss due to poor web applications performance
  • In November 2009, a computerized system used by US based airlines to maintain flight plans failed for several hours causing havoc amongst all major airports. This caused huge delays to flight schedules causing inconvenience for thousands of frustrated passengers. Identified as a ‘serious efficiency problem’ by the Federal Aviation Authority, this was one of the biggest system failures in US Aviation History!
  • Aberdeen found that inadequate performance could impact revenue by up to 9%
  • Business performance begins to suffer at 5.1 seconds of delay in response times of web applications and 3.9 for critical applications and an additional second of waiting on a website significantly impact customer satisfaction and visitor conversions. Page views, conversions rate and customer satisfaction drops 11%, 7% and 16% respectively!
  • A/c to Amazon: Every 100ms delay costs 1% of sales

Load Runner 11.5

These are the major changes in LR11.5

New and Improved VuGen
– The whole look and feel of VuGen has been revamped here to include much more modular panes and viewing ability. While there are a handful of default views available, these are easily modified to taste. Tree view has been replaced with the new step navigator and the new solutions explorer gives access to all actions, run time and parameter panels.
  1. Ajax TruClient Firefox Enhancements – Changes here include a move to Firefox 8 and support for HTML5. Functions can be created for easy reuse and event handlers are available to support asynchronous behaviors. I think the HTML5 is a significant advancement. We’ve actually seen a demo from HP of a Vugen script playing back a game Angry Birds.
  2. Ajax Truclient Internet Explorer – A new addition to the Ajax TruClient family, HP is establishing TruClient as a cross browser solution for capturing heavy AJAX front went applications. Now companies who created their application with Internet Explorer support only can find bugs under load that they would not have simply because Firefox may run different code. Applications must work in IE9 standard mode to be supported.
  3. Web Protocol Asynchronous Support – the Web (HTTP/HTML) as well as Flex, Silverlight and Web Services have been modified to support advanced applications that make use of asynchronous communications such as Poll, Long Poll and Push. This means applications such as chat, messaging, stock tickers, and news updates that use various asynchronous mechanisms should be easier to script against.
  4. Improved Correlations – Correlations can now be found based on server responses during recording, so you don’t always have to play it back at least one to start correlation. Coupled with the new Correlation Studio interface, introduced in LR 11 which gives us regular expressions and XPATH, scripting becomes easier and faster.
  5. Flex Enhancements – Improvements here include use of Web Correlation mechanisms, support for Web requests and the bundling of Adobe Flex platform jars into the application. In addition, there is now support for RTMP FMS streaming, RTMPT, RTMPS and GraniteDS.
  6. Mobile Protocols– Initially introduced in FP4 of LoadRunner 11, these protocols enabe script development for http-based and native mobile applications. Traffic based analysis is used for native applications and Ajax TruClient technology is used for browser based mobile applications.
  7. Data Format Extension (DFE) for Google Web Toolkit (GWT) – In addition to the already supported formats of Base64, JSON, URLEncoding, XML and Prefix-Postfix, support is now included for Google Web Toolkit (GWT). This includes: Formatting the GWT RPC data into readable and correlate-able content, addition of more data such as object field names and simple parameterization.
  8. Additional important updates for support include 64-bit recording in Vugen (very important), .NET 4.0 support, WCF application support enhancements, and IPV6 support.

JVM in load testing

The Java Virtual machine (JVM) is the application that executes a Java program and it is included in the Java package.
JVM is the main component of Java architecture and it is the part of the JRE (Java Runtime Enviroment) . JVM is a part of Java Run Time Environment that is required by every operating system requires a different JRE .

Each operating system and CPU architecture requires a JRE.
JVM Runtime Environment contains the two parts such as:
Java API classes: Java API classes are the predefined classes required for the program compilation and interpretation.
Java Virtual Machine: JVM is also a part of the JRE. The Java Virtual Machine is responsible for interpreting Java bytecode, and translating this into actions or operating system calls .

Without the availability of a JRE for a given environment, it is impossible to run Java software.

The Java Runtime Environment (JRE), also known as Java Runtime, is part of the Java Development Kit (JDK), a set of programming tools for developing Javaapplications. The Java Runtime Environment provides the minimum requirements for executing a Java application; it consists of the Java Virtual Machine (JVM), core classes, and supporting files.

During installation, Java Runtime Environment also deploys a plugin that facilitates the execution of applets within local browsers.
JVM is not platform independent.
The Windows JVM is different from the Unix JVM or the Linux JVM. But, your Java code can run on all three without being changed or recompiled (again, unless you interface to native methods, or use other platform-specific stuff).

Java "the language" is platform-independent. To make it so, there is a platform-specific JRE that knows how to run the platform-independent Java code on a specific platform.
Every supported operating system has its own JVM.
JDK includes a JRE as as subset. The JRE provides runtime support for Java applications. The SDK provides the Java compiler and other development tools. The SDK includes the JRE.

When we download JRE, there are different platforms to choose. That means JRE is machine dependent,

In one machine we can create more than 1 JVM. Suppose in load testing there is a problem in JVM then its not a good practice to increase the size of JVM to solve the performance issue.

For analysizing the JVM many tools are available:
1.JProfiler
You can have one JVM per process. Since an OS supports many processes, you can have many JVMs running.
When ever we start a new java process by invoking java.exe (i.e. java [class-name] ) a new instance of JVM is created. Each java process executes in its separate JVM environment – we can specify different JVM parameter for each process

Jconsole - standard freely available
Yourkit profiler - licensed
Netbeans profiler - freely available.
JPerfmeter: Its gud one.

Heap Size:


Increasing the maximum heap size setting can improve startup. When you increase the maximum heap size, you reduce the number of garbage collection occurrences with a 10 percent gain in performance.

Increasing this setting usually improves throughput until the heap becomes too large to reside in physical memory. If the heap size exceeds the available physical memory, and paging occurs, there is a noticeable decrease in performance.
Therefore, it is important that the value you specify for this property allows the heap to be contained within physical memory.

How to determine that your machine has a static IP(Static IP vs Dynamic IP)

How to determine that your machine has a static IP

1. Type ipconfig /all at command prompt.If DHCP Enabled is "No" then machine has static IP,if it has Yes then machine has dynamic IP(DHCP(Dynamic Host Configuration protocol).).

2. Open the "Local Area connection" dialog box.Then click on Support tab.If Address type is "Manually configured" then machine has static IP. and if it has "DHCP" enabled then machine has dynamic IP.

How much load we can generate from a LG

Web vusers are hosted by a process called mmdrv.exe (check task manager when running a test, you will see it there). There is one copy of the process for each 50 vusers so a 200 user test will have 4x that process.

Each process uses about 7MB + about 350KB for each vuser (changes slightly according to version of LR, OS, size of script, logging level, recording options, day of week, whether it is raining etc)

So a 200 user test would be (4x7MB) + (200x350KB) = about 98MB, more or less. Scale up for your own requirements.

Other protocols use more memory (e.g. TruClient uses about 20MB per vuser I think)

Generally, don't go above about 70% CPU or memory usage on the load generator (monitor the LG as part of a test-the-test-system test to make sure). So work out how much free memory you have on your machine, take 70% of that value, then calculate as above.

How many Java Virtual Machines (JVMs) does LoadRunner use? If the user runs 20 Java Vusers, will that use 20 JVMs or just one JVM?

Solution


JVMs are loaded per-process.If you are running the Vusers as a process, then there will be one JVM for each Vuser. If they are running as threads, there will be as many Vusers to a JVM as there are threads to the process.

Example: To run 20 Vusers in Controller:

If you are running 10 threads per process, there will be 2 mdrv.exe processes launch, and hence 2 JVMs.
If you are running 5 threads per process, there will be 4 mdrv.exe processes launch, and hence 4 JVMs.Additional Information:
To verify the number of processes launch, you can check the number of mdrv.exe processes using the task manager.

Load Runner 11.0

Here in this post I am going to describe various things that are required or need to understand with respect to Load Runner 11.0

OS that support LR 11.0


Windows Vista SP2 32-bit
Windows XP Professional SP3 32-bit
Windows Server 2003 Standard Edition/Enterprise Edition SP2 32-bit
Windows Server 2008 Standard Edition/Enterprise Edition SP2 32-bit and 64-bit
Windows 7
Note: VuGen recording is not supported on 64-bit operating systems.

How to download and Extract LoadRunner version 11 (LR 11)?


Navigate to the support portal: http://support.openview.hp.com/Click on "Downloads" tab
Click on "Demos and Downloads"
Enter your HP Passport credentials when needed.
You will have visibility to LR 11 (and other) downloads, if you have support for LoadRunner 11 as part of your HP Support Agreement Identifier (SAID) — HP SAIDs can be configured in the HP Passport Profile.

Is Internet Explorer 9 supported by LR or PC 11.x ?

The base version of LR / PC 11.x doesn't support IE 9 by default; you need to contact customer support to get a patch on top of your base installation. It is known as Patch 3, once installed it will support IE9.

LoadRunner 11 applications (controller, VuGen GUIs) are slow to come up
After installing LoadRunner 11 the application UIs are very slow to be presented at sometimes.
It may take a minute or more for VuGen to be presented after it’s launched.
To resolve this slowness try the following
1. Install the latest LoadRunner 11 patches.
2. Add a proxy setting in IE / Internet Settings, if your environment uses a proxy for web/Internet access.
3. If the above does not work, open the following file in notepad :
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
Replace empty element:

with this:





Correlation rules are not working in LoadRunner 11 ??

The reason why the correlation rules are not working is because the value to be correlated in the generation log in response body is in Plain text format, but when it is used in the script it is in URL format.
for instance in the generation log value is
"3,10 Feb 2011 18:50:13 -0000"
in the script the value is
"3%2C10 Feb 2011 18%3A50%3A13 -0000"
The same value "3%2C10 Feb 2011 18%3A50%3A13 -0000" is also a part of the request body, hence is not being captured.
The automatic correlation rule only handles 2 conversions for formatting as follows:
1. From HTML to URL
2. From URL to HTML

it does not handle Plain text to URL
When you do manual correlation, we are capturing the value and then using the function web_convert_param () to convert the plain text format to URL format, and hence it can be handled on the script. The correlation rules does not have the same level of flexibility as manual functions.
To fix this issue manually correlate the value.

Issue in replay due to redirections

If your application has URL redirections, you may experience issues while replaying if the redirection depth is set to zero. For instance, you may encounter error messages similar to the following: "Action1.c(x): Redirecting "http://easyloadrunner.com " (redirection depth=0)" followed by "Action1.c(x): Error: Failed to connect to server..."

The root cause of this issue is that the redirection depth is set to zero. To overcome this problem, you can implement one of two solutions: either modify the config file or use a function in your script to change the value.

To modify the config file, follow these steps:

1. Navigate to the \template\qtweb directory.
2. Open default.cfg in a word editor.
3. Locate the [web] section.
4. Add an entry for MaxRedirectionDepth and set its value to the desired number of redirections (e.g., MaxRedirectionDepth=x, where x is the desired number).

Make sure to repeat the above steps for the default.cfg file in the script folder as well.

Alternatively, you can use the web_set_option function in your script to change the redirection depth value. Here's an example of how to do it:

web_set_option("MaxRedirectionDepth", "4", LAST); // Sets the maximum redirection depth to 4.

Errors encountered while running vusers in controller regarding illegal names in script files

While running Vusers in the Controller the user receives the following errors: 

Error: "82000 One or more of the script's files have illegal names. It is possible that two files are using the same name and directory."

Error: "84805 The user files were not transferred to the local load generator" 

The scripts run fine on the local host but experience the above error while trying to run on a remote machine

Resolution:

Make sure that all the scripts names and parameters are unique
1. Make sure that all the scripts' names and parameters are unique. Please note that you should not create any script or parameter with a difference case. For example, "LoadRunner" or "loadrunner" will not make any difference to the Controller.
2. Make sure that the path where the script is saved does not exceed Window's maximum path length (260 characters). If it is, try to save the script in some other location with shorter path.
3. Make sure that all the parameters referencing the same parameter file use the same case for the file name/file path when it is being added to the script. If the case for the parameter file name/file path differs, it might causes problems.
4. Make sure that the "ScriptName".prm file references the parameter in the script in correct case. If not, it might cause problems.
5. Make sure that there are no spaces in the parameter file names. Embedded spaces will work for VuGen but not for Performance Center.
6. The file name of the parameter file itself (and the path) should be the same as the Table value in the prm file. If TableLocation is not "Local", ensure the parameter file exists in the path specified.

How to check the Transactions done by a Vuser in Analysis

The Analysis data pulls out the transaction data for all the vusers for your test run. If you are interested in getting data for a particular vuser then you can do that by:

Go to Transactions Summary Report, right-click on the graph and select filter.
On the filter page select VuserID filter and give a proper value or range of Vuser to get the appropriate data.You can give different Vuser by separating them with comma line 2,5 for Vuser2 and Vuser5.

If you are not sure what is the VuserIDs during your test run then click on vusers button and it will list the VuserID used during your test.

Need Admin rights for Replay Vugen Scripts

Admin rights required to replay the script. Generally we get these type of error while replay the script through Vugen without having admin rights.

Warning: Extension LrXml.dll reports error -1 on call to function ExtPerThreadInitialize
Error: Vuser failed to initialize extension LrXml.dll.
If you do not want to give admin rights and want to replay the scripts then follow the following steps:(These steps are mainly for 9.1 and later version).

Navigate to the following location:
\\dat\\protocols
If it is web protocol, go to QTweb.lrp
if it is citrix protocol , go to citrix.lrp or citrix_ica.lrp
Go to LRP file based on the script being used,
Open the relevant file in a Notepad
Look for: ResultsDirUI=1
Comment it out by adding a semicolon. For example: ;ResultsDirUI=1
Save the changes to the file
Hope by doing this script should not give error during Replay.

How to Check that you have admin rights:

1.On XP - right-click on the clock in the tray and select the Adjust Date/Time command. You get a message if you don't have admin rights.

2. Another way is:

right click on start
check if you have the option to "open all users"
if it's there, you have admin rights3. Another way is:
a) Right click on My Computer and select Properties
b) Select the Computer Name tab.
c)If the Change… button is grayed out, the user is not logged in with administrator rights.

How to choose virtual users as process or thread

Thread

1) If you run each Vuser as a thread, the Controller launches only one instance of the driver program (such as mdrv.exe), for every 50 Vusers (by default). This driver process/program launches several Vusers, each Vuser running as a thread. These threaded Vusers share segments of the memory of the parent driver process. This eliminates the need for multiple re-loading of the driver program/process saves much memory space, thereby enabling more Vusers to be run on a single load generator.

2) The main advantage of a multi thread environment is the ability to run more Vusers per load generator.

3) Only thread safe protocols should be run as threads.

Process

1) If you run each Vuser as a process, then the same driver program is launched (and loaded) into the memory again and again for every instance of the Vuser. Loading the same driver program into memory uses up large amounts of RAM (random access memory) and other system resources. This limits the numbers of Vusers that can be run on any load generator.

2) The protocols Sybase-Ctlib, Sybase-Dblib, Informix, Tuxedo, and PeopleSoft-Tuxedo are not thread safe, so need to run as process.

More thread Vusers can run on a machine

When running the Vuser as a process, LoadRunner will create 1 process per Vuser. So if you have 50 Vusers, you will have 50 mdrv.exe processes on your machine
When running the Vuser as a thread, LoadRunner will create 1 thread per Vuser. So if you have 50 Vusers, then you will have 1 process with 50 threads running inside it if the limit is 50 threads per process.

For a process:

program counter - identifying next instruction to execute.
processors register set - contains register values.
text segment - contains code section.
data segment - contains variable content.
stack segment - contains temporary data such as subroutine parameters, return addresses, temporary variables.

For a thread:

The text segment and the data segment are being shared by multiple threads within 1 process. Each thread will have its own allocation for the rest of the module.
That is why you will be able to run more Vusers as threads than as processes since less memory resources are being taken. By default, most of LoadRunner Vuser's is set to run as a threads unless they are not thread safe.

How to lower the amount of threads per process in LoadRunner.

In LoadRunner versions later than 7.51, such as LoadRunner 9.x, please perform the following steps:
1)Go to the INS_DIR>/dat/protocols/QTWeb.lrp file.
2)By default, in web protocol the number of threads mdrv can spawn is 50. Change this value to a lower value (E.g. 10) by adding/changing the following:

[VuGen]
MaxThreadPerProcess=50
3. Re-run the scenario

What is Web Server and how it works

A web server can mean two things - a computer on which a web site is hosted and a program that runs on such a computer. So the term web server refers to both hardware and software. We'll look at each of these individually.

The web server computer - the hardware
A web site is a collection of web pages. And web pages are digital files, typically written using HyperText Markup Language (HTML). For a web site to be available to everyone in the world at all times, it need to be stored or "hosted" on a computer that is connected to the internet 27/7/365. Such a computer is known as a web Server (note the first letter is in uppercase). You can potentially host a web site on your home computer but this involves a lot of work and constant monitoring. It is easier to "buy" web hosting from a company because there are thousands that offer this service.

There are several requirements for a Server computer - it needs to be fast, have a large storage capacity hard disk and lots of RAM. But the most important is having a permanent internet address also known as an I.P. (Internet protocol) address. If the I.P. address changes, the web site would not be found and will appear offline - the browser will display a cannot find web site kind of error. For details, read differences between your home computer and a web Server.

The web server program - the software

A web server program is software that runs on the web site hosting Server computer. Its main purpose is to serve web pages; which means it waits for requests from web browsers (also known as clients) and responds by sending the required data back. This client-server interaction is the hallmark of the web!

There are many web server programs available. The most famous and popular of all web servers isApache developed by the Apache Foundation. Not only is Apache free but it's also available for several operating systems including Windows, Macintosh and Linux/Unix.

FYI, the differentiating the web server program and the computer by the capitalization of the first letter for the latter is suggested and followed only by purists - it is not a rule; your readers would quickly understand from the context whether you are referring to the hardware or the software.

What is the role of web server on the Internet?

Web servers - the computer or the program - have a vital role on the Internet. The Server machine hosts the web site while the server program helps deliver the web pages and their associated files like images and flash movies.

The process of loading a web site/page in a web browser starts with the user either entering the URL in the address bar or clicking on a link. You should know that each web page has a unique address (orURL) on the internet; which means the same page cannot exist in two places. (If a copy does exist in another location, its address would be different from that of the original).

The browser now needs to send out a request for the web page. Behind the scenes, the URL of the requested web page is resolved into an I.P. address, which in English means, converted to an I.P. address - something that computers understand. The I.P. address points to the location of the web site host and the request is forwarded to Server computer and passed on to the server software.

The server software now takes up and hunts for the requested web page on the hard disk. On finding the file, it sends back a response and the web page file to the browser which then starts displaying the page. A typical web page not only has text but also embedded multimedia elements like images and Flash animation. These "extra" files are separate from the actual web page and need to be sent one by one for the browser to display the web page correctly. Note(and an important one), ONLY the web browser determines how a web page is displayed; the web server has no control over this. The job of a web server ends once it processes the request from a browser and sends the required information.

Though the request-and-response might seem time consuming, it actually happens very fast - have you ever waited more than a minute for a web site to load? And it's all because of the HyperText Transfer Protocol (HTTP) which is a set of rules developed by the "big lads" to facilitate the transfer of data over the internet.

Need Admin rights for Replay Vugen Scripts

Admin rights required to replay the script. Generally we get these type of error while replay the script through Vugen without having admin rights.

Warning: Extension LrXml.dll reports error -1 on call to function ExtPerThreadInitialize
Error: Vuser failed to initialize extension LrXml.dll.
If you do not want to give admin rights and want to replay the scripts then follow the following Steps:(These steps are mainly for 9.1 and later version).

Navigate to the following location: \\dat\\protocols
If it is web protocol, go to QTweb.lrp
if it is citrix protocol , go to citrix.lrp or citrix_ica.lrp
Go to LRP file based on the script being used,
Open the relevant file in a Notepad
Look for: ResultsDirUI=1
Comment it out by adding a semicolon. For example: ;ResultsDirUI=1
Save the changes to the file
Hope by doing this script should not give error during Replay.

How to Check that you have admin rights:

1.On XP - right-click on the clock in the tray and select the Adjust Date/Time command. You get a message if you don't have admin rights.

2. Another way is:
right click on start
check if you have the option to "open all users"
if it's there, you have admin rights3. Another way is:
a) Right click on My Computer and select Properties
b) Select the Computer Name tab.
c)If the Change… button is grayed out, the user is not logged in with administrator rights.

When recording a Web Protocol script over HTTPS, Security Alert dialog(s) are displayed indicating that there is a problem with the site's security certificate

When recording a Web Protocol script against HTTPS sites (e.g. https://www.example.com/) popup alerts are displayed:
Clicking on "View Certificate" results in the certificate details being displayed:

Note that while these dialogs are displayed, it may still be possible to complete a recording and generate a script that can then be replayed.

Cause

The certificates included with LoadRunner 9.x expired on the 4th January 2011.

Fix

This issue is resolved by replacing the existing certificates with updated versions with a later expiry date. Replacement certificates may be found in this patch file:
lr_ssl_ca_patch.zip.
The certificates to be updated are located in two LoadRunner directories as follows:
1. \bin\certs e.g. "C:\Program Files\HP\LoadRunner\bin\certs" (Six ".crt" files require to be replaced or created if they do not exist),
2. \bincerts e.g. "C:\Program Files\HP\LoadRunner\bincerts" (One ".crt" file requires to be replaced - this directory may not be present in older LoadRunner versions),
To update the certificates, follow these steps:
1. Close any open LoadRunner components (e.g. VuGen),
2. Place the zip file in the directory e.g. "C:\Program Files\HP\LoadRunner",
3. Unzip the zip file to replace the expired certificates in both "\bin\certs" and "\bincerts".
To confirm the correct application of this patch check that the following files were replaced in "\bin\certs":
wplusCA.crt
wplusCAOnly.crt
wplusCert.crt
wpluskey512.crt
wpluskey1024.crt
wpluskey2048.crt
Check that the following file is replaced in "\bincerts":
wplusCA.crt
The new certificate files should be dated 29th December 2010 and will expire in 2020.

Load Runner Analysis error "Object reference not set to an instance of an object"

Error:
Sometimes we got the error "The system cannot find the file specified".

Cause:This error comes when the following files in (Analysis Install dir)\bin\dat\ are corrupted:
loader2.mdb, loader.mdf, loader.ldf

Solution:
You need to restore these files; take these files from another machine where you have installed the Analysis. Or Re-install the Analysis on your machine after a clean uninstall.

Debugging steps for issues about Virtual User Generator (VuGen)

If VuGen crashes intermediately or shows abnormal behavior, verify/try the following:

Try to login to the machine as a local administratorTry to log in as a local administrator rather than user who is currently logged in. If this helps resolve the issue of VuGen crashing this would indicate that the cause of the problem is privileges of this particular user who is logged in. Check with your System Administrator on what privileges can/cannot be added to this user.

Make sure that there are sufficient Disk SpaceMake sure that you have enough disk space available on the VuGen. If the machine does not have enough disk space, it can cause problem.

Try to recreate the VuGen’s initialization fileSometimes, the initialization files can become corrupted (e.g. after a crashed). You will have problem in launching or using the VuGen after that. Use the following steps to do delete the initialization file so that a new copy will be created:
1. Shut the VuGen.
2. Navigate to the C:Winnt ( or C:Windows for Windows XP machine )
3. Delete the file named vugen.ini.

Check the temporary environment variablesUnlike the earlier window’s versions, Window 2000 and Window XP have the default environment set to c:Document and SettingsLocal SettingsTemp instead of c:Windowstemp. This long path with a space can cause several problems on LoadRunner. To resolve the issue, change to a directory without empty spaces.

Verify the MDAC version

Make sure that you have MDAC 2.6 or higher installed.
Check the version of the MSADCO.DLL file:

Browse to C:\Program Files\Common Files\System\MSADC
Riight click on the MSADCO.DLL Choose Properties
Click the Version tabThe File Name Version will indicate what version you are using.

NOTE: You can right click on any of the .DLL files in the MSADC directory and they should all display the same version information.

Reboot
When programs crash, they leave the system in an unstable state. This can cause many other problems that seem to have no apparent reason for happening or has not happened before. When the system is rebooted, it resets the system into a more stable state. This should be done after any program crashes.

Shut down all unnecessary processesSome programs are designed to have certain DLLs "hook" or be loaded into another program’s memory space. Normally, this should not have any effect on the application itself. However, it can interfere with some programs and cause them to behave erratically or crash.
For such, it would be recommended to shut down all processes that are not necessary, regardless if they hook into LoadRunner or not. Any programs that run as an icon in the system tray or on the taskbar are the first candidates for termination. Also, you can look through the list of processes in the Task Manager (right-click on the taskbar and select "Task Manager"). Some processes are system processes, which may not be able to be shut off, but any processes that can be shut down should be.

Disable anti-virus software:
It is known that anti-virus software is intrusive when they are set to look for viruses. However, in searching for viruses, the software can interfere with a program’s proper execution. This could cause problems and sometimes crashes. This is why, for debugging purposes, we would recommend turning off the anti-virus software.
The icon for the anti-virus software resides in the system tray (where the clock is located). Normally, you should be able to right-click on the icon and select "disable." However, some setups do not allow a user to turn off the anti-virus software. It is recommended to speak to a system administrator to get the anti-virus program disabled for a short period for debugging the problem.

Reinstall:In case that all the above steps fail, the only recourse left would be to try to uninstall LoadRunner. It is possible that either a previous version of LoadRunner was on the machine before the current installation or that the installation did not go properly although the installation did not give any errors. It is recommended that a full uninstall be done in this case. The following steps are for a full uninstall:
1. Make sure that, all running LoadRunner processes (including the Controller, VuGen, Analysis and the Remote Command Launcher (for 6.x) or the LoadRunner Agent Process/Service (for 7.x) are closed.
2. Backup any existing scripts that may have been saved in the LoadRunner installation folder (The scripts are sometimes saved in a ‘scripts’ subdirectory under the LoadRunner installation folder.).
3. Run the uninstall program from the LoadRunner program group (or) use the Windows add/remove programs from the Control Panel. If any prompt is given about removing shared files, remove all the shared dlls that are reported as no longer being in use. In the very rare instance this causes a problem for some other application it may be necessary to re-install that other app. This is not generally a problem because every application should have registered which DLLs it needs to run.
4. Reboot the machine after the Uninstall wizard is complete. This will complete the basic uninstall procedure.
5. Delete all LoadRunner Folders. (Including the ones in the startup menu for Remote Command Launcher (LoadRunner 6.x) or Agent Process (LoadRunner 7.x)

6. Do a search for the following files and remove them from all locations — they will be replaced during the re-install.
a. wlrun.*
b. vugen.*

7. Bring up the registry editor: (Start à Run à regedit).

8. Delete the following keys:

a. Only for LoadRunner 6.x
HKEY_LOCAL_MACHINESOFTWAREBORLAND
b. If Load Runner is the only Mercury Interactive product on this machine, then delete
HKEY_LOCAL_MACHINESOFTWAREMercury Interactive.
HKEY_CURRENT_USERSOFTWAREMercury Interactive.
c. Else delete
HKEY_LOCAL_MACHINESOFTWAREMercury InteractiveLoadRunner.
HKEY_CURRENT_USERSOFTWAREMercury InteractiveLoadRunner.

9. Empty the Recycle-bin.
After you remove these items, you can re-install LoadRunner. Also, make sure that you do not have any anti-virus programs running while you are installing LoadRunner. That has been known to cause some problems with the installation of LoadRunner.
NOTE: Reinstallation should only be done for the following certain circumstances.
1. The crash only happens on a particular machine.
2. Some feature that was previously working is now crashing.
3. The above options were tried before hand.

Best practices for creating scripts in VuGen using LoadRunner

In order to have a vugen script properly created, is necessary to ensure no errors or warnings are present, there are few other steps to complete to be able to consider that the script is properly developed.
This is a recommended checklist of the steps that should be complete for a script creation.
Note that this checklist has some items that only apply to web-based scripts and is optional to follow,
  1.  All values that should be correlated have been correlated.
  2.  Text checks (using web_reg_find) have been added before each web_url and web_submit_data function.
  3.  ContentCheck Rules have been added for all known error messages.
  4. All server requests (web_url, web_submit_data) are being measured with a transaction (lr_start_transaction, lr_end_transaction, lr_set_transaction).
  5.  Script runs without causing errors, and any warnings are due to legitimate reasons (e.g. download filters).
  6. File-based parameters have the correct “select next row” and “update value on” settings.
  7.  Correct runtime settings have been set. 
This means:
  • Action blocks have been weighted with correct percentages in Run Logic.
  •  Pacing intervals have been set to the correct value that will achieve target throughput with the given number of vusers.
  •  Full logging has been disabled, and size of “send messages only when an error occurs” lgo cache has been increased.
  • Think time set to replay as a random percentage, and think time values in script are not ridiculously large. No think time inside transactions.
  •  Any needed download filters have been set.
  •  All other runtime settings have been set as per internal standards.

VuGen hangs when trying to create parameters

When trying to create a new parameter in VuGen, the CPU utilization for VuGen.exe goes up to 100% and stays there eventually causing VuGen to crash.
Diagnosis: The ss32x25.ocx file was not registered on the machine.

Solution
Register the ss32x25.ocx file on the VuGen machine.
1. Check if ss32x25.ocx exists in C:\WINNT\system32 or C:\windows\system32 where it is copied to during the LR/VuGen installation.
2. Check the version of the .ocx file, and confirm it is 2.5.0.20.
Note:
If the file is not present or the version is a lower one, copy it from a working LoadRunner machine, or, it can be found in the LoadRunner installation DVD, under this folder:
lrunner\MSI\setup_j\register
3. Register the ss32x25.ocx file using regsvr32.
Use the regsvr32 command to register or unregister a DLL

To register a DLL or OCX file
Method 1:
1. Open a DOS window.
2. Navigate to the DLL’s or OCX’s directory.
3. Enter regsvr32.exe .
Example:
regsvr32.exe mylibrary.dll
Method 2:
1. Go to Start -> Run and enter regsvr32.
2. Open Windows Explorer and find the file.
3. Drag the file from the Windows Explorer window into the Run dialog window. This will enter the full path to the DLL or OCX file.
4. Click
Example:
regsvr32.exe "c:program filesMercurymylibrary.dll"

To unregister a DLL or OCX file
Method 1:

1. Open a DOS window.
2. Navigate to the DLL’s or the OCX’s directory.
3. Enter regsvr32.exe /u .
Example:
regsvr32.exe /u mylibrary.dll
Method 2:
1. Go to Start -> Run and enter regsvr32 /u.
2. Open Windows Explorer and find the file.
3. Drag the file from the Windows Explorer window into the Run dialog window. This will enter the full path to the DLL or OCX file.
4. Click

How to set the system’s TEMP and TMP directories

Windows limitation of maximum path length on the temporary directory of Performance Center load generator

Problem
When running VuGen scripts in Performance Center and the following error appears:
"Error: The user files were not transferred to the local load generator."
Cause
The controller cannot transfer the script files to the Load Generator.
When running a scenario in LoadRunner Controller / Performance Center, the Controller transfers the Vugen script files to the temporary location on the Load Generators. The temporary location will be created under \\netdir\\.

For example, if the script in Controller is stored in c:\VugenScript\Script1 and the Load Generator has the temporary folder set to C:\Documents and Settings\Default User\Local Settings\Temp, the Load Generator would save this script file in C:\Documents and Settings\Default User\Local Settings\Temp\\netdir\c\VugenScript\Script1.

This is caused by a limitation of the maximum path length on Windows OS. The length limitation is 255 bytes in Windows XP and 260 bytes in Windows Vista. Please refer to MSDN: File Names, Paths, and Namespaces(http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx) for more details on this limitation.Fix
On the Load Generator:
A. If you are running the agent as a process, you can change the "TEMP" system Variable of the user from C:\Documents and Settings\Default User\Local Settings\Temp to C:\Temp.

B. If you are running the agent as a service, you can change the service to use an account with Administration privileges, and change the admin account’s "TEMP" system variable to a shorter path:
- Go to Start -> Control Panel -> Administrative Tools -> Services.
- Look for the LoadRunner / Performance Center Agent Service.
- Right-click and select Properties->Log On, changing this from "Local System account" to "This account", supplying the Administrative account username and password.
- To change the admin user temporary location is described below:

How to set the system’s TEMP and TMP directories

Changing the system’s temporary directories
To create a temporary directory:
1. Bring up Windows Explorer, find a drive that has sufficient space.
2. If TEMP folder does not exits, create a directory called "TEMP" in the root location of the drive.
Example: C:\TEMP
To add/change the temporary environemnt:
1. For Windows 2000 or Windows XP machine:
a. Right-click on the ‘My Computer’ icon on the desktop and select ‘Properties’.
b. Go to the Advanced tab and click on the ‘Environmental Variables’ button.
c. There are two sections listed: User Variables and System Variables. Under each section, you should see a variable for TEMP and TMP.
d. Double-click on these entries, and modify the location to the temporary environment created above.
Example:
Change from C:\Documents and Settings\\Local Settings\Temp
Change to C:\TEMP
e. Click .
2. For Windows NT machine:
a. Right-click on the ‘My Computer’ icon on the desktop and select ‘Properties’.
b. Go to the ‘Environmental’ tab.
c. There are two sections listed: User Variables and System Variables. Under each section, you should see a variable for TEMP and TMP.
d. Double-click on these entries, and modify the location to the temporary environment created above.
Example:
Change from C:\Documents and Settings\\Local Settings\Temp
Change to C:\TEMP
e. Click .

How to raise a Case to HP

Steps to add SAID(Support Agreement ID):
1. Open this link https://support.openview.hp.com/entitlement/contracts
2. Enter your HP Passport username and password (if you don’t have one, Kindly register a new user)
3. Add this SAIDs “10123456740” at bottom of the page.

Once you have added the contract to your profile, you can open a support case. Kindly follow these steps to open a support case:

1. Open this link http://support.openview.hp.com/casemanager/incident-index
2. Click “Submit a new case” on the left.
3. Select “Quality Center” for Product field.
4. Select the Product version, Sub-product, Operating System, SAID, Severity
5. Click “Next”
6. Enter Case title and Case details
7. Click “Next”
8. Click “Submit Case”

Server has shut down the connection prematurely | Server has shut down the connection prematurely error in load runner

The issue "Server ABC has shut down the connection prematurely" typically arises within LoadRunner and can be a significant challenge to address. Here are steps to troubleshoot and resolve this issue:

1. Sequential Ramp-Up: Ensure that the load is not ramping up all users simultaneously. Gradual ramp-up of virtual users can help prevent sudden spikes in server load.

2. Rendezvous Points: Check if rendezvous points in the script are not holding up too many users simultaneously. Rendezvous points should be strategically placed to synchronize virtual user activities without overwhelming the server.

3. Retry Option: Verify that the retry option in LoadRunner is set to a value greater than 5. This can help handle connection retries effectively, reducing the likelihood of premature shutdown errors.

4. Network Connectivity: Investigate network connectivity issues or blockages between the LoadRunner Controller/Load Generator and the server under test. Network instability can lead to connection problems.

5. Reduce Load: Consider reducing the load generated from the LoadRunner machine to lessen the strain on the server. This can involve decreasing the number of concurrent users or adjusting the workload distribution.

6. Clear Temp Folder: Clear the temporary files in the local settings folder on the machine where LoadRunner is installed. Restart the machine afterward. This step has proven effective for resolving the issue, particularly if scripts previously ran successfully without errors.

7. Restart Machines and Servers: If the issue persists, restart all machines and servers within your network or load test domain. While the reason behind this solution may not be clear, it often resolves the problem.

Additionally, consider implementing the following script modifications as workarounds:

- Add the line `web_set_sockets_option("NEW_BEHAVIOR_OF_OVERLAPPED_SEND", "1");` to the script. Although not a solution, it can sometimes mitigate the issue.
  
- If none of the above options are effective, include `web_set_sockets_option("IGNORE_PREMATURE_SHUTDOWN", "1");` in the `vuser_init()` function. This setting instructs LoadRunner to ignore premature shutdown errors during script execution.

Furthermore, you may explore the following LoadRunner settings:

- Navigate to Run-time Settings → Preferences and select "Use WinInet Replay instead of Sockets" (for Windows environments only). Note that while this option has worked in specific cases, it may not provide a universal solution.

It's essential to note that the recommendation regarding the retry option ("Make sure retry option is greater than 5") specifically applies to Oracle 10g applications and may not be relevant in all scenarios.

How to give different percentage of user load from different location in Controller

If we want to give different user load percentage from different location then we need to create multiple group with that particular script then we can assign different percenatge of user load from different locations.

Example:observe the following scenario

User load: 30% from Japan,10% from US,10% from Aus,25% from UK and 25% from India.
In this case we need to create 5 different groups and assign the above user load from each location.Note:We cannot give all above user percentage to a single group

Industry standard for loading time of a website

Here are some Industry standard response time. This is very useful when we don't have any data.

Response time to display web pages:
- 3 seconds considered excellent
- 3-5 second acceptable
- over 5 seconds and it is not a search, considered unacceptable.

For a search transaction, anything upto 7-8 seconds is considered acceptable.

For web services, under 1 second is excellent.
Upto 3 seconds may be acceptable.

Load Testing Think Time Distributions

One of my gripes about some commercial load testing tools is that they only provide a think time distribution (Z) that is equivalent to uniform variates in the client-script. If you want some other distribution, you have to code it and debug it yourself. Load test generators are essentially very expensive workload simulators; especially when you take into account the cost of the SUT platform. At those prices, a selection of distributions should be provided as a standard library—like they are in event-based simulators.

To make this point a bit clearer, I used the very convenient variate-generation functions in R to compare some of the distributions that I consider should be included in such a library for the convenience of workload-test designers and performance engineers. The statistical mean (i.e., the average think delay) is the same in all these plots and is shown as the red vertical line, but pay particular attention to the spread around the mean on the x-axis.


Uniform: The first plot (upper left) shows the default uniform distribution with a mean Z = 10 seconds and a range between 5 and 15 seconds. This is what a standard random number generator produces. Each call in the script will produce an explicit think delay somewhere around 10 seconds. The typical frequency of occurrence for each variate is shown in the y-axis. I'm usingseconds here as the nominal time base for think delay.

Exponential: One of the most common alternative delay distributions is the exponential distribution. There are two reasons you might want to use this distribution:

It increases the likelihood of queueing and therefore detecting buffer overflows in the SUT

It makes test results easily comparable to a PDQ model, which always assumes an exponential Z distribution

The exponential distribution is associated with a Poisson process. A Poisson distribution belongs to the kind of randomness you hear in the clicks of a Geiger counter (e.g., in the movies). The time between those clicks is exponentially distributed. The asymmetry of the distribution about the mean, makes it more useful than a uniform distribution for load testing.

Gamma: Often there is considerable gnashing of teeth over the exponential distribution not being realistic. Quite apart from the usual academic technicalities, it's a better choice than uniform. That said, a suitable generalization, which introduces more correlations into the arrivals, is the gamma distribution. Whereas the exponential distribution is defined in terms of a single arrival-rate parameter (λ), the gamma distribution is defined by two parameters: the shape (α) and scale (β). Setting α = 1 and β = λ, produces the exponential distribution.

Pareto: Finally, the Pareto distribution is suitable for simulating highly correlated arrivals, such as has been discussed ad nauseum in the context of Internet packets. The Pareto distribution emulates heavy-tailed or self-similar traffic. Since Perato is a hyperbolic-class function, it corresponds to infinite variance effects or almost constant variance over many decades, in practice.