Sunday, 13 May 2012

How to check LG is installed and enabled and How much load can generate

First of all LG and Controller are physical machine on which we installed LG software.

To check LG s/w in installed:
Go to command prompt--> Type Services.msc-->Check Performance center Agent Service--> If its status is started then LG s/w is installed.

In LG machine,in the right bottom corner you can see one small red tower icon  and if you take mouse over that it will show Performance center Agent Service.
In controller you are not able to see small red tower icon  but you can see "Performance center Agent Service" in the services.msc.

How to check version of LG on a machine

Go to control panel--> Add remove Program--> Check the version of HP performance center Host with SP1/Patch1


                                    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.

Another method:


Firstly, identify a single Vuser footprint as follows:

  • Create a scenario in the Controller which uses your script, and set the number of iterations to 30 in the Run Time Setting. It should be configured to run until complete.
  • Using the Windows Resource Monitor, configure %Process Time and Private Bytes counters on the mdrv.exe process in order to measure the footprint. Note that in order to configure these counters, you should first run the script to have mdrv.exe running. Run the scenario just for the sake of configuring the counters and then stop and save it before initiating the real test.
  • Run the scenario and make sure the monitor data is collected
  • As soon as the scenario execution ends, analyze the results using the Analysis tool. Make sure you analyze complete data and not only summary data.
  • Open the Windows Resource graph and make a note of the average CPU and peak memory utilization.

Now, you can determine the number of Vusers per LG. You need to work out how many Vusers the CPU can sustain, and how many the memory can accommodate.

  • This formula will give you the number of Vusers the CPU can sustain:

Number of Vusers per CPU = (70% * Number of Core Processors)/ Vuser Average CPU Usage

(We recommend limiting it to 70% so as not to overuse the CPU)

  • This formula gives you the number of Vusers the memory can accommodate:

Number of Vusers by Memory = (Total GB RAM of LG – GB RAM allocated for the operating system and other processes) / Vuser Peak Memory Usage

(You might want to reserve 1GB for the OS etc)

The number of Vusers that you are looking for should be the lower of these two values.

Here’s a table with some examples:

No of Core Processors
Average CPU usage of Vuser (%)
Vusers for CPU
(70%*No of Core Processors)/Average CPU usage of Vuser
Total Assignable Memory (GB)
(Total Memory-1GB)
Peak Memory per Vuser (MB)
Vusers for Memory
(Total Assignable Memory/Peak memory per Vuser)
Lower of “Vusers per CPU” and “Vusers by Memory”
8
10
(70*8)/10=56
8-1=7
80
7GB/80MB=89
56
4
22
(70*4)/22=12
8-1=7
100
7GB/100MB=70
12
8
6
70*8/6=93
16-1=15
120
15GB/120MB=125
93

It’s not bulletproof – different scripts have different considerations and requirements, so it’s difficult to say categorically that this will work. But it should be enough to get you started.


Another view:

The mdrv.exe is a driver process which is responsible for running Vusers on your load generator. Even after LR11.xx, this process continues to be 32 bit one. So the maximum addressable space is 4GB by this process.

Running VUsers as thread has an advantage of sharing this 4 GB of space between a lot of threads. With the increase in number of users, you can see the instances of mdrv.exe increasing on your load generator to accommodate the users.





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.


Wednesday, 9 May 2012

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.

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.

DHCP(Dynamic Host Configuration protocol).

Thursday, 26 April 2012

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).
  1. Navigate to the following location: <LR>\\dat\\protocols
    1. If it is web protocol, go to QTweb.lrp
    2. if it is citrix protocol , go to citrix.lrp or citrix_ica.lrp
  2. Go to LRP file based on the script being used,
  3. Open the relevant file in a Notepad
  4. Look for:      ResultsDirUI=1
  5. Comment it out by adding a semicolon. For example:      ;ResultsDirUI=1
  6. Save the changes to the file
Hope by doing this script should not give error during Replay.
 
Error -27279: Internal Error – Report initialization failed, error code=-2147467259
 
I’m using Windows 7 and LoadRunner 11.50 build 2216. I looked in the HP support and found an article  that suggested that the way to resolve this was to run any LoadRunner script once as an administrator. Once you’ve done this, you’ll have “cured VuGen” of this fault.
This solution worked for me, here are the steps that I took:
  • Right click the VuGen shortcut and choose the option to “run as administrator”
  • Run the script once, the error should not appear.
  • Close VuGen

 I re-tested other Vugen script and error gone.

 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:
  1. right click on start
  2. check if you have the option to "open all users"
  3. if it's there, you have admin rights
3. 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.


Monday, 2 April 2012

What is Web Server and how it works

What is web server - a computer of a program?
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 is Apache 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 (or URL) 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.

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.

 
Solution

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



Tuesday, 27 March 2012

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:
The certificates to be updated are located in two LoadRunner directories as follows:
1.     <LR_install>\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.     <LR_install>\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 <LR_install> directory e.g. "C:\Program Files\HP\LoadRunner",
3.     Unzip the zip file to replace the expired certificates in both "<LR_install>\bin\certs" and "<LR_install>\bincerts".
To confirm the correct application of this patch check that the following files were replaced in "<LR_install>\bin\certs":
  • wplusCA.crt
  • wplusCAOnly.crt
  • wplusCert.crt
  • wpluskey512.crt
  • wpluskey1024.crt
  • wpluskey2048.crt
Check that the following file is replaced in "<LR_install>\bincerts":
  • wplusCA.crt
The new certificate files should be dated 29th December 2010 and will expire in 2020.


Wednesday, 21 March 2012

90th Percentile response time

The 90th percentile response time value is the value for which 90% of the data points are smaller   and 10% are bigger.

To calculate the 90th percentile value:

1. Sort the transaction instances by their value.
2. Remove the top 10% instances.
3. The highest value left is the 90th percentile.

Consider the below example:

There are 10 instances of transaction “TRANSACTION 01” with the values
4 sec 2 sec 3 sec 1 sec 5 sec 17 sec 8 sec 7 sec 6 sec 10 sec

1. Sort values from best to worst:
    1 sec 2 sec 3 sec 4 sec 5 sec 6 sec 7 sec 8 sec 10 sec 17 sec

2. Remove top 10%, In our case i.e. value “17 sec”
   1 sec 2 sec 3 sec 4 sec 5 sec 6 sec 7 sec 8 sec 10 sec

3. The highest value left is the 90th percentile value i.e. “10 sec” is the 90th percentile value.

How to Change Password of IUSR_METRO Account

Sometime we need to change the password of IUSR_METRO Account. This may be required due to compliance issue. Below are the steps to chang...