Wednesday, February 27, 2008

Load runner FAQ

Load runner FAQ

lr_save_string:- Saves a null-terminated string to a parameter.
lr_save_var:- Saves a variable length string to a parameter.
lr_eval_string:- Its replace the current value with existing values.
lr_message: function sends a message to the Output window and the Vuser log file. When run in VuGen, the output file is output.txt.
lr_output_message: function sends a message with the script section and line number to the Output windows and the Vuser log file
lr_error_message : Sends an error message to the LoadRunner output window or Application Management agent log file.
lr_log_message: Sends a message to the Vuser log file.
lr_think_time: Pauses execution between commands in a script

web_set_max_html_param_len:- The web_set_max_html_param_len function sets the maximum length of any HTML string which Vugen can retrieve and save in a parameter. The default value for the maximum length of a parameter that can be captured during correlation is 256 characters (see web_reg_save_param). To retrieve a string longer than 256 characters, use web_set_max_html_param_len to increase the maximum valid length. An attempt to save a string whose length exceeds the maximum length will fail.

Standard Log: - Sends a sub set of functions and messages sent during script executions to a log. The subset depends on the vuser type.
Extended Log: - Sends detailed script execution messages to the output log. Select the type of extended information to log.

Load test: - confirm the stability of the application and infrastructure under average or peak workload conditions
Stress tests: - confirm the stability of the application and infrastructure under “above-peak” workload conditions
Endurance tests: - confirm the reliability of the application and infrastructure under average workload conditions over an extended period of time

Enable content Check during replay:-Vugen's content check mechanism enables you to detect all types of errors sent by the web server.

Lr_rendezvous function:-The lr_rendezvous function creates a rendezvous point in a Vuser script. When this statement is executed, the Vuser program stops and waits for permission from LoadRunner to continue.

Each Occurrence: - The Each occurrence method instructs the Vuser to use a new value for each occurrence of the parameter. This is useful when the statements using a parameter are unrelated. For example, for random data, it may be useful to use a new value for each occurrence of the parameter.

Each Iteration: - The Each iteration method instructs the Vuser to use a new value for each script iteration. If a parameter appears in a script several times, the Vuser uses the same value for all occurrences of the parameter, for the entire iteration. This is useful when the statements using a parameter are related.

Once: - The Once method instructs the Vuser to update the parameter value only once during the scenario run. The Vuser uses the same parameter value for all occurrences and all iterations of the parameter. This type may be useful when working with dates and times.

HTML Mode: - HTML based scripts generates separated steps for each user actions. Script containing explicit URL only Record within the current scrip step

URL Mode: - URL based scripts records all request and resources from the server.

Run Vusers as a process:- (Disables multithreading and runs each vuser as a complete process).
The Controller uses a driver program (e.g., mdrv.exe, r3vuser.exe) to run your Vusers. 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.

Run Vusers as a thread :-( Enables multithreading to run more vuser per load generator machine)
if you run each Vusers as a thread, the Controller launches only one instance of the driver program (e.g., mdrv.exe), for every 50 Vusers (by default). This driver process/program launches several Vusers, each Vuser running as a thread. 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.

Parameter Types: - date/time, file, groupname, iterationnumber, loadgenerator name, random number, table, unique number, user defined function, VuserID

Manual Scenario: - When you design a regular manual scenario, you create Vuser groups, assign them scripts, load generator machines, and virtual users. When you work in the Percentage Mode, you define the total number of Vusers to be used in the scenario, and assign load generators and a percentage of the total number of Vusers to each script.

Goal-Oriented Scenario: - Load Runner automatically builds a scenario for you based on these goals. You can define five types of goals in a goal-oriented scenario: the number of virtual users, the number of hits per second (Web Vusers only), the number of transactions per second, the number of pages per minute (Web Vusers only), or the transaction response time you want your scenario to reach. You define one of these scenario goals using the Edit Scenario Goal dialog box.

Correlations: - To generate dynamic data many applications and Web sites identify a session by the current date and time. If you try to replay a script, it will fail because the current time is different than the recorded time. Correlating the data enables you to save the dynamic data and use it throughout the scenario run.

Pacings: - As soon as the previous iteration ends:
The new iteration begins as soon as possible after the previous iteration ends

At fixed or random intervals, every ... [to ...] seconds:
For example, assume that you specify to start a new iteration every four seconds:
If the first iteration takes three seconds, the Vuser waits one second.
If the first iteration takes two seconds to complete, the Vuser waits two seconds.
If the first iteration takes 8 seconds to complete, the second iteration will start 8 seconds after the first iteration began. LoadRunner displays a message in the Execution Log to indicate that the iteration pacing could not be achieved.

Fail open transactions on lr_error_message:- This option instructs Vugen to mark all transactions in which an lr_error_message function was issued, as Failed. The lr_error_message function is issued through a programmed If statement, when a certain condition is met.

Generate Snapshot on Error: - This option generates a snapshot when an error occurs. You can see the snapshot by viewing the Vuser Log and double-clicking on the line at which the error occurred.

Simulate browser cache: - This option instructs the Vuser to simulate a browser with a cache. A cache is used to keep local copies of frequently accessed documents and thereby reduces the time connected to the network. By default, cache simulation is enabled. When the cache is disabled, LoadRunner still downloads each page image only once. When running multiple Vusers from the Controller, every Vuser uses its own cache and retrieves images from the cache. If you disable this option, all Vusers emulate a browser with no cache available.

Download non-HTML resources: - This option instructs Vusers to load graphic images when accessing a Web page during replay. This includes both graphic images that were recorded with the page and those which were not explicitly recorded along with the page. When real users access a Web page, they wait for the images to load. Therefore, enable this option if you are trying to test the entire system, including end-user time (enabled by default). To increase performance and not emulate real users, disable this option.

You view the Hits per Second, Pages per Second, and Response Bytes per Second (Throughput)
Graphs during test execution using the online monitors and after test execution using the Analysis. You view the Component Breakdown graph after test execution using the Analysis. Select the types of graph data for the Vuser to collect.

File and line in automatic transaction names:-Creates unique transaction names for automatic transactions by adding file name and line number to the transaction name enabled by default.

Non-critical item errors as warnings: - This option returns a warning status for a function which failed on an item that is not critical for load testing, such as an image or Java applet that failed to download. This option is enabled by default. If you want a certain warning to be considered an error and fail your test.

Formula to calculate Pacing

Run the script in Vugen for 1 Iteration with think time settings (Same as load Test) - > x
Number of iteration in Hr = y
Number of minutes the script run(M) in Hr = (x * y) + Ramp Uptime
Number of minutes Idle in Hr( I) = 60 Mins - M
PACING = ((I/(Number of Iteration -1)) * 60 Seconds )
* Ramp up Time is the Time taken for all the user to Ramp Up.
Note :
Once you get the PACING value, you can either give Fixed(same as PACING value) or Random (PACING + or - 60)
Example
TC 1 Needs to run for 5 Iteration in 1 Hr
In Vugen it took 6 Mins for 1 iteration with the Think time setting same as in load Test
Ramp Up Time is 10 Mins
Number of iteration in Hr = 5
Number of minutes the script run (M) in Hr = (5 * 6) = 30 Mins
Number of minutes Idle in Hr( I) = 60 Mins - 30 Mins = 30 Mins
PACING = (30 Mins/(5 -1)) * 60 = 450 Seconds - 300 Seconds(
If you want to go for Fixed pacing then 150 Seconds
If you want to go for Random pacing then 90 to 210 seconds


Keep-Alive HTTP connections: Keep-alive is a term used for an HTTP extension that allows persistent or continuous connections. These long-lived HTTP sessions allow multiple requests to be sent over the same TCP connection. This improves the performance of the Web server and clients.
The keep-alive option works only with Web servers that support keep-alive connections. This setting specifies that all Vusers that run the Vuser script have keep-alive HTTP connections enabled. (Yes by default)

DNS caching: Instructs the Vuser to save a host's IP addresses to a cache after resolving its value from the Domain Name Server. This saves time in subsequent calls to the same server. In situations where the IP address changes, as with certain load balancing techniques, be sure to disable this option to prevent Vuser from using the value in the cache. (enabled by default)

HTTP version: Specifies which version HTTP to use: version 1.0 or 1.1. This information is included in the HTTP request header whenever a Vuser sends a request to a Web server. The default is HTTP 1.1. HTTP 1.1 supports the following features:
Persistent Connections—see "Keep-Alive HTTP connections" below.
HTML compression—see "Performing HTML Compression".
Virtual Hosting—multiple domain names sharing the same IP address.

Step timeout caused by resources is a warning: Issues a warning instead of an error when a timeout occurs due to a resource that did not load within the timeout interval. For non-resources, VuGen always issues an error. (No by default)

Parse HTML content-type: When expecting HTML, parse the response only when it is the specified content-type: HTML, text\html, TEXT any text, or ANY, any content-type. Note that text/xml is not parsed as HTML. The default is TEXT.

Accept Server-Side Compression: Indicate to the server that the replay can accept compressed data. The available options are: None (no compression), gzip (accept gzip compression), gzip, deflate (accept gzip or deflate compression), and deflate (accept deflate compression). Note that by accepting compressed data, you may significantly increase the CPU consumption. The default is to accept gzip, deflate compression.

Accept-Language request header: Provides a comma separated list of accepted languages. For example, en-us, fr, and so forth.
HTTP-request Connect Timeout (seconds): The time, in seconds, that a Vuser will wait for the connection of a specific HTTP request within a step before aborting. Timeouts provide an opportunity for the server to stabilize and respond to the user. The default value is 120 seconds.

HTTP-request Receive Timeout (seconds): The time, in seconds, that a Vuser will wait to receive the response of a specific HTTP request within a step before aborting. Timeouts provide an opportunity for the server to stabilize and respond to the user. The default value is 120 seconds.

Step download timeout (seconds): The time that the Vuser will wait before aborting a step in the script. This option can be used to emulate a user behavior of not waiting for more than x seconds for a page.

Network Buffer Size: Sets the maximum size of the buffer used to receive the HTTP response. If the size of the data is larger than the specified size, the server will send the data in chunks, increasing the overhead of the system. When running multiple Vusers from the Controller, every Vuser uses its own network buffer. This setting is primarily for advanced users who have determined that the network buffer size may affect their script's performance. The default is 12K bytes.

Fixed think time upon authentication retry (seconds): Automatically adds a think time to the Vuser script for emulating a user entering authentication information (username and password). This think time will be included in the transaction time. The default is 0.

Request Zlib Headers: Sends request data to the server with the zlib compression library headers. By default, requests sent to the server include the zlib headers. This option lets you emulate non-browser applications that do not include zlib headers in their requests. To exclude these headers, set this option to No. The default value is Yes.

GUI-Mode default block size for DOM memory allocations: Sets the default block size for DOM memory allocations. If the value is too small, it may result in extra calls to malloc, slowing the execution times. Too large a block size, may result in an unnecessarily big footprint. The default is 16384 bytes.
GUI-Mode single setTimeout/setInterval threshold (seconds): Specifies an upper timeout for the window.setTimeout and window.setInterval methods. If the delay exceeds this timeout, these methods will not invoke the functions that are passed to them. This emulates a user waiting a specified time before clicking on the next element. The default is 5 seconds.

GUI-Mode accumulative setTimeout/setInterval threshold (seconds): Specifies a timeout for the window.setTimeout and window.setInterval methods. If the delay exceeds this timeout, additional calls to window.setTimeout and window.setInterval will be ignored. The timeout is accumulative per step. The default value is 15 seconds.

GUI-Mode fail on JavaScript error: Fails the Vuser when a Javascript evaluation error occurs. The default is No, issuing a warning message only after a Javascript error, but continuing to run the script.

GUI-Mode history support: Enables support for the window.history object for the test run. The options are Enabled, Disabled, and Auto. The Auto option (default) instructs Vusers to support the window.history object only if it was used in the first iteration. Note that by disabling this option, you improve performance.

GUI-Mode Maximum history size: The maximum number of steps to keep in the history list. The default is 10 steps.

lr_get_host_name
Returns the name of the host executing the Vuser script.

1 comment:

Anonymous said...

Hi,

your pacing calculation was good until -300 sec calculation.

I am not able to understand the reason by - 300 sec. would appreicate if u explain on it