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



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...