2. Agenda
2
INTRODUCTION
• WCAT is a lightweight HTTP load generation tool .
• Designed to measure the performance of a web server within a controlled
environment.
• Simulate thousands of concurrent users making requests to a single web site
or multiple web sites
• WCAT engine uses a simple script to define the set of HTTP requests to be
played back to the web server
3. FEATURES
3
• HTTP 1.0 and HTTP 1.1 capable
• Supports IPv6
• Multithreaded Support
• Supports generating stress from multiple machines
• Extensible through C plug-in DLLs
• Supports Performance Counter integration
• Measures throughput and response time
• Supports SSL requests
• NTLM Authentication request support
• Easily supports testing thousands of concurrent users
4. BENEFITS
4
• Very light weight (low hardware requirements)
• Extensible to handle any aspect of the HTTP request or response
5. Requirement
5
WCat 6.3 supports the following Operating Systems:
• Windows XP
• Windows Server 2003
• Windows Vista
• Windows Server Code-named "Longhorn"
6. Installing WCAT
6
Prerequisite: all machines that will run WCAT must have the administrator account
enabled.
• Download the WCAT 6.3 file
64 Bit: http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1467
32 Bit: http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1466
• Run the installation package
• Read the introduction to WCAT included in the installation
• By default WCAT will be installed in the following location “C:Program Fileswcat”
7. WCAT SETUP ON CLIENT
7
Client is the machines that will actually issue the commands to the server simulating your web clients
Once the installation done we need to have a basic setup to run the wcat in client
• open a command prompt (as administrator if on vista/windows7)
• cd c:program fileswcat
• Run cscript //H:Cscript
• Run wcat.wsf -terminate -update -clients localhost
Note: If you’re running the above command for the first time the machine will reboot.
8. WCAT SCRIPT CONFIGURATION
8
WCAT has 2 files types for executing the WCAT Scripts
• *.ubr (Settings.ubr and scenario.ubr)
• *.bat
Settings.ubr: The settings file contains parameters that are specific to a test environment
clientfile The Scenario files to use for the test to be run. The scenario file is the text file that contains the
scenario { … } element.
server A comma separated list of Web Servers or IP addresses to generate load against. The list must
contain no spaces. (example: “web1,web2,web3” is OK, “web1, web2, web3” is NOT OK)
Clients No of client physical machines
VirtualClients The number of virtual clients to simulate from each physical client. For example, if 8 physical client
machines are used, and this value is specified as 4, then a total of 32 connections will be simulated.
9. WCAT SCRIPT CONFIGURATION
9
Scenario.ubr: This file contains the test scenario and data that need to be tested.
warmup The warmup period, in seconds. WCAT uses a “warmup” period in order to allow the Web Server
to achieve steady state before taking measurements of throughput, response time and
performance counters. WCAT will divide the warmup phase into two parts. For the first half of
the warmup period WCAT will slowly add virtual clients until all virtual clients have been activated.
The second half is pure load generation.
duration This is the duration in seconds that WCAT should run AFTER the warmup phase. The duration
phase is when WCAT samples data.
cooldown In order to ensure that measurements end before load generation ends a cool down period in
seconds must be specified. Recommended time is 20 seconds.
10. WCAT SCRIPT CONFIGURATION
10
.BAT FILE.
.bat file sample
START wcctl.exe -s wcatpoc.cloudapp.net -t "scenario.ubr" -f "settings.ubr" -virtualclients 100 -clients %1%
set maxvalue=%1%
echo %maxvalue%
For /L %%f In (1,1,%maxvalue%) Do (START wcclient.exe -b)
-s: server or hostname
-t: scenario file
-f: settings file
Virtualclient: physical client (browser)
Client: client machine
11. SCENARIO SCRIPT GENERATION
11
Building more complex scripts can be a pain and time consuming.
WCAT Scenario Creator will reduce the pain and time in building complex scripts.
Prerequisite to build complex script
• Download and install Fiddler 2.0, by default fiddler will be installed in the path “C:Program
Files (x86)Fiddler2”
http://www.fiddler2.com/Fiddler2/version.asp
• Download the WCATScenarioGenerator.dll and copy to the script folder which present inside
the fiddler installed path
http://fiddler2wcat.codeplex.com/releases/view/35356
12. Steps to generate the scenario file:
12
• Open fiddler and click the launch IE button from within Fiddler2
• It will start recording a list of sessions along the left side
• After you've got a sequence on the left you want to save to a scenario for WCAT do the following:
• Select the result for which you have to create scenario
13. 13
• In fiddler 2 the bottom left you should see a black rectangle. This is where you can type commands
for the WCAT extension
• Type wcat reset
• Type wcat addtrans
• Type wcat save
• you will now have a file called fiddler.wcat in your fiddler2 installed folder
• open fiddler.wcat and save it to your c:program fileswcat as scenario.ubr
Note: If the UBR file has repetitive content. All the repetitive content specially the set-header stuff which is same for
the entire request should be moved down to default block. This will reduce the length of the file and avoid
complexity.
14. RUNNING WCAT SCRIPTS
14
RUNNING IN LOCAL.
• open a command prompt (as administrator)
• cd c:program fileswcat
• cscript //H:Cscript
• wcat.wsf -terminate -update -clients localhost
• run batch file (.bat) followed by space & a number (number indicates clients)
• Example: kronos.bat 2
• Finally check Log.xml for Result. Log.xml file will be automatically gets updated when WCAT stops
running.
Note: If the log.xml does not opening in a clear format, open it in the IE's compatibility mode.
Prerequisite: report.xsl file should be present in the folder where your log.xml resides.
15. 15
In log.xml you get the following details
• Network Statistics
• Time Analysis
• Response Time Analysis
• Request/Response Statistics
• HTTP Status Codes
• Transaction Statistics
• Errors
• per Client Statistics
16. 16
RUNNING IN AZURE VIRTUAL MACHINE
• Open the Azure portal www.windows.azure.com
• Connect with the Virtual Machine
• Paste the WCAT folder in it.
• open a command prompt (as administrator)
• cd c:program fileswcat
• cscript //H:Cscript
• wcat.wsf -terminate -update -clients localhost
• run batch file (.bat) followed by space & a number (number indicates clients)
• Example: kronos.bat 2
• Finally check Log.xml for Result. Log.xml file will be automatically gets updated when WCAT stops
running.