Академический Документы
Профессиональный Документы
Культура Документы
THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-
INFRINGEMENT. CITRIX SYSTEMS, INC. (“CITRIX”), SHALL NOT BE LIABLE FOR TECHNICAL OR EDITORIAL
ERRORS OR OMISSIONS CONTAINED HEREIN, NOR FOR DIRECT, INCIDENTAL, CONSEQUENTIAL OR ANY
OTHER DAMAGES RESULTING FROM THE FURNISHING, PERFORMANCE, OR USE OF THIS PUBLICATION, EVEN
IF CITRIX HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES IN ADVANCE.
This publication contains information protected by copyright. Except for internal distribution, no part of this publication may
be photocopied or reproduced in any form without prior written consent from Citrix.
The exclusive warranty for Citrix products, if any, is stated in the product documentation accompanying such products.
Citrix does not warrant products other than its own.
Product names mentioned herein may be trademarks and/or registered trademarks of their respective companies.
Copyright © 2002 Citrix Systems, Inc., 851 West Cypress Creek Road, Ft. Lauderdale, Florida 33309-2009 U.S.A. All
rights reserved.
Version History
INTRODUCTION.............................................................................................................................................................................1
SUMMARY ...................................................................................................................................................................................14
Client Configuration...............................................................................................................................................................18
Metrics ..................................................................................................................................................................................19
User Experience....................................................................................................................................................................19
vUser Initialize.......................................................................................................................................................................20
• How to setup and execute a Mercury Interactive’s LoadRunner solution in a Citrix MetaFrame
environment
At the conclusion of this paper, an Appendix is provided providing detailing a limited implementation of
Mercury LoadRunner for Citrix.
MetaFrame Farm
ICA Screen
• Requires Server side Updates
Agents
• Scalability
• Windows Information
• Exposes some window events such as re-size / move / create / destroy, etc.
• Input Events
• Expose events such as Mouse Move / Mouse Click / Key Down, etc.
• Input Simulation
The virtual users are created using a recording technology that captures the ICA traffic between the client and server
into a high level, easy to read, maintainable test script. These scripts can be easily modified to represent real users
with their own sets of data and replay speeds. By licensing key Citrix technology, LoadRunner’s virtual users generate
exactly the same traffic as the ICA client and “fool” the system into believing it is under the load of real production
users.
By measuring the end-to-end response time of user transactions, LoadRunner helps identify performance problems
from the end users perspective. Using a suite of real-time performance monitors that measure the system performance
across all the tiers, LoadRunner can also help isolate these problems wherever they lie in the system. Finally, all the
test scripts created in pre-deployment load testing with LoadRunner can be reused as-is in Topaz for performance
monitoring once the application goes live.
As with all testing strategies, tests are only as accurate at the workflows utilized to emulate real life scenarios. For
example, scripts that emulate users running a word processing program for typing and saving of files may not produce
accurate results if printing is usually performed but not incorporated into the script’s workflow. Thus, when developing
virtual user scripts, it is important that the scripts replicate the actions of real users to obtain accurate results.
IC
A
In order to successfully run LoadRunner you need the following minimum system configuration. Refer to http://www-
svca.mercuryinteractive.com/products/loadrunner/technical/ for the most updated installation requirements:
When developing scripts it is also important to define script parameters and run-time settings. Parameters are defined
for fixed-values recorded into the vUser script. By substituting fixed-values with parameters, the same business
process can be repeated many times using different values. An example of this is logging into a Citrix session. When
recording the logon activities of a Citrix session, the user’s credentials entered are captured and hard coded into the
script. By using parameters, each vUser executing the script can log into the server with a different user account’s
credential set. Run-time settings control the vUser behavior during the execution of a vUser script. These settings
include the pacing, logging, think time, and connection information.
Workflows to emulate a Citrix user are separated into three different scripts. vUser_init is used to execute the
connection and logon to the MetaFrame server. The Actions script is used to perform the actual application workflows.
The Actions are repeated a configurable number of times. vUser_end is used to perform any clean up and disconnect
from the MetaFrame server.
A .pdf file exists detailing the development of Citrix vUser scripts and configuring the Citrix Monitor on the LoadRunner
controller. This document (Developing Citrix vUser Scripts.pdf) is available on Mercury’s support website:
http://support.merc-int.com. You must register with Mercury to access this site.
Recording Tips
• When recording a session, make sure to perform the complete business process, starting with the
connection and ending with the cleanup. End your session at a point from where you could start the
entire process from the beginning.
• Configure the Citrix server to completely close a session. Open the Citrix Connection Configuration
dialog box. Choose Start > Programs > Citrix > MetaFrame XP > Citrix Connection Configuration.
Double-click on the ica-tcp connection name. The Edit Connection dialog box appears. Click on the
Advanced button. In the bottom section of the dialog box, clear the inherit user config check box
adjacent to the On a broken or timed-out connection list box. Change the entry for this list box to reset.
• Display settings of 1024 x 768 are recommended on the recording machine. This will allow the Citrix
window, which is 800 x 600 to be displayed properly.
• When opening expanded menu options, click explicitly on each option—do not depend on the expanding
menu. For example, Start > Programs > Microsoft Word, be sure to click on the word Programs.
• If having trouble with window or dialog box names not being consistent, edit the script to use wildcards
(*). For example, ctrx_set_window("Spelling and Grammar:*”);
Replay Tips
• To prevent overloading by multiple vUsers while connecting, set an initialization quota or use a ramp up
schedule from the Controller’s scheduler.
• For best results, do not disable think time in the run-time settings. Think time is especially relevant after
ctrx_set_window and before ctrx_type functions, which require time to stabilize.
Debugging Tips
• You can view additional replay information in the Extended log. You enable Extended logging from the
Run-Time settings (F4 Shortcut key) Log tab. You can view this information in the Execution Log tab, or
the output.txt file in the script’s directory. When running a LoadRunner scenario each vUser generates its
own execution log located in C:\mercury
interactive\LoadRunner\scripts\ScriptName\res\log\scriptname_vUserID.log.
• When an error occurs, VuGen saves a snapshot of the screen to the script’s output directory. You can
view the bitmap to try to determine why the error occurred.
• To check the version of the server, make sure the MetaFrame XP server is installed. Select Citrix
Connection Configuration on the server’s console toolbar and choose Help > About.
Step1: Planning the test. Successful testing requires development of a thorough test plan. A clearly defined test
plan ensures that the LoadRunner scenarios that are developed will accomplish the load testing objectives. Load test
planning involves:
• Analyzing the application to determine hardware and software components, the system configuration, and
typical usage patterns.
• Defining testing objectives (i.e. Maximum user load, application upgrade compatibilities, identifying
bottlenecks).
• Planning the LoadRunner implementation. This involves defining the scope of performance
measurements, defining vUser workflows, Selecting vUsers, and choosing test hardware.
Step2: Creating vUser Scripts. vUsers emulate human users interacting with the system under test. vUser scripts
contain the actions that each virtual user will perform during a scenario execution. These scripts should emulate what
real users typically do with the system in a production environment.
Step3: Creating the Scenario. A scenario describes the events that occur in a testing session. A scenario includes
defining the client machines that vUsers will run on, scripts that vUsers will execute, and a specified number of vUsers
or vUser groups that run the scenario. Scenarios are created using the LoadRunner Controller.
Step4: Running the Scenario. User load is emulated by instructing multiple vUsers to perform tasks simultaneously.
Before executing a scenario, configuration and scheduling is defined. This determines how all the load generators and
vUsers behave when the scenario is run. While a scenario is run, LoadRunner measures and records the transactions
defined in the vUser scripts. The performance of the system under test (hardware resources) is also monitored and
captured for later analysis.
Step5: Monitoring the Scenario. Using LoadRunner’s online run-time performance monitors, all components of the
system under test can be monitored. Additional details on Monitoring MetaFrame servers resides in the LoadRunner
Step6: Analyzing Test Results. Throughout execution of a scenario, LoadRunner records the performance of the
system under test at different load levels. LoadRunner’s graphs and reports can be utilized to analyze the systems
performance. For more information about LoadRunner’s reports and graphs, see the LoadRunner Analysis User‘s
Guide.
Configuration Details
The following list details the architecture and configurations that were used to conduct the scalability
analysis:
• Users were assigned a mandatory profile
• Mercury LoadRunner, version 7.51, was used to simulate concurrent user sessions
• The Mercury LoadRunner Load Generator was installed on the client device to run Virtual Users that
initiate the ICA connections and run vUser scripts to emulate user workflows.
• A custom script was created for Microsoft Word 2000 and Internet Explorer 6.0 using LoadRunner’s
VuGen recording utility.
• LoadRunner Controller’s Citrix MetaFrame XP Resource Monitor was used to gather metrics.
Server Specifications
• Compaq ProLiant DL360
• Two Compaq NC7780 Gigabit NIC (embedded, only one active, running at 100mb) 10/100 WOL (Wake
On LAN)
Workstation Computer
Laptop
Client Devices
C
7 8 9 101112
A 12 34 56 1x 2x 3x 4x 5x 6x 1x 2x 3x 4x 5x 6x
A B
The servers and client devices were connected to an Ethernet switch with a 100mb backbone. The
users’ profiles were stored on locally on the MetaFrame server. For this proof of concept, the
LoadRunner controller was also used as the client device executing vUser sessions, but any number of
client devices can be used.
• Client Settings:
Metrics
The following table outlines the metrics monitored during the project. The values were gathered at the
server level using the Citrix MetaFrame XP Resource Monitor (RM) integrated into the LoadRunner
Controller’s Application Deployment Solutions monitor.
Resource Counter Object Source
Evaluated
User Experience
Transactions were placed into the vUser scripts to capture the amount of time a particular action took to
complete. By analyzing these results, latency can be measured and user experience can be better
quantified. However, there is no replacement for actual users measuring the “user experience”. By
running real users in conjunction with the scripted test, a subjected analysis can be performed. This
analysis can be divided into the following three categories. Integrating real users was not in the scope
of this proof of concept and therefore was not performed.
Fair Screen updates are noticeable and latency is increased. However, the user is
still able to function.
Poor The session becomes frozen or disconnected. Therefore, the user cannot
continue his/her tasks.
Network Utilization
Network utilization testing was beyond the scope of this proof of concept. Network utilization plays an
extremely important role in determining system scalability and user experience. A congested network
will not only limit the number of sessions that can be executed concurrently, but will also affect the
amount of latency each user feels within their Citrix session. Things to be considered include:
• Network link sizes and bandwidth utilization
• Client actions (file transfers, printing and print job sizes, etc.)
• # of concurrent users
The following workflows were created to emulate basic usage of these applications. The script contains many areas
where synchronization or transactions were added manually. The synchronizations kept the script running during
periods of high latency while transactions were used to determine the amount of time a particular action took to
complete.
Note: The scenarios used did not include saving to local client drives/remote file servers or printing. If these actions
take place in the environment under test, they should be accounted for in vUser scripts to obtain accurate test results.
vUser Initialize
1. Logon a vUser.
Actions
1. Close Existing Document
4. Modify the documents properties (File -> Properties). Add a document title
// Start Transaction
// End transaction
// Start Transaction
// End Transaction
18. Click on the link of the first result returned from the search
vUser End
1. Close Microsoft Word (File -> Exit)
{ ctrx_set_connect_opt(APPLICATION, "#Word");
ctrx_set_connect_opt(NETWORK_PROTOCOL, "TCP/IP");
/* Parameters added for userid of the vuser so each login is with a different account */
lr_think_time(1);
ctrx_wait_for_event("LOGON");
Actions ()
lr_think_time(2);
ctrx_key("f", MODIF_ALT);
ctrx_set_window("Microsoft Word");
lr_think_time(3);
ctrx_key("f", MODIF_ALT);
lr_think_time(2);
ctrx_type("n");
ctrx_set_window("New");
lr_think_time(2);
ctrx_key("ENTER_KEY", 0);
lr_think_time(3);
/* Save document with time date stamp parameter so we can continue to use
the same paramater to reference the window through out the script */
ctrx_key("f", MODIF_ALT);
ctrx_type("s");
ctrx_set_window("Save As");
lr_think_time(5);
ctrx_type("this is a test.");
lr_think_time(2);
ctrx_key("f", MODIF_ALT);
lr_think_time(1);
ctrx_type("i");
ctrx_type("LoadRunner Test");
lr_think_time(4);
lr_think_time(3);
ctrx_key("ENTER_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_type("is Virtual User\'s script was created by EdRod, this paragraph should talk about
what a great person he is. Or, maybe not. So I\'m going to type a fw ");
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_type("ew words that are miispelled so that I can runn the spell checker. Being a
Virtual User is thd coolest thing in the world. I live sttres");
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_type("e tal");
ctrx_key("BACKSPACE_KEY", 0);
ctrx_type("sk. ");
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_key("BACKSPACE_KEY", 0);
lr_think_time(1);
ctrx_key("BACKSPACE_KEY", 0);
ctrx_type("http://www.ct");
ctrx_key("BACKSPACE_KEY", 0);
lr_think_time(3);
ctrx_key("ENTER_KEY", 0);
lr_think_time(1);
ctrx_key("ENTER_KEY", 0);
ctrx_type("Sincerely,");
ctrx_key("ENTER_KEY", 0);
lr_think_time(2);
ctrx_key("ENTER_KEY", 0);
lr_think_time(1);
ctrx_type("Virtual User");
lr_think_time(10);
lr_think_time(2);
lr_think_time(2);
/* Begin spell check. Note the use of the wildcard for the window title*/
lr_think_time(3);
lr_think_time(3);
lr_think_time(4);
lr_think_time(3);
lr_think_time(3);
lr_think_time(3);
lr_think_time(3);
lr_think_time(3);
lr_think_time(3);
lr_think_time(3);
lr_think_time(5);
lr_think_time(3);
lr_think_time(3);
lr_think_time(2);
/* Finish spell and grammer check. Click OK button to the spell check complete dialog */
ctrx_set_window("Microsoft Word");
lr_think_time(5);
ctrx_unset_window("Microsoft Word");
lr_think_time(4);
/* Start transaction to open a web browser from an embedded URL. Use the
lr_start_transaction("open browser");
lr_think_time(3);
lr_think_time(2);
/* End transaction */
lr_end_transaction("open browser",LR_AUTO);
lr_think_time(5);
lr_think_time(3);
lr_think_time(5);
ctrx_set_window("Citrix ");
ctrx_type("cmc");
lr_think_time(5);
lr_start_transaction("KB search");
/* End transaction */
lr_end_transaction("KB search",LR_AUTO);
lr_think_time(7);
ctrx_set_window("C");
lr_think_time(8);
ctrx_key("f", MODIF_ALT);
lr_think_time(4);
lr_think_time(3);
lr_think_time(3);
ctrx_key("f", MODIF_ALT);
lr_think_time(3);
ctrx_type("s");
vuser_end ()
lr_think_time(5);
ctrx_key("f", MODIF_ALT);
lr_think_time(3);
ctrx_type("x");
lr_think_time(1);
ctrx_disconnect_server("ccslabs32");