WCAT: Easy, Magical, Stress Testing for IIS Web Applications

Posted: Jul 19, 2006  5 comments  

Average Rating

Share this Post

Introduction

Reality sat in when I, along with Wade Hilmo & Alexis Eller, headed to Europe for the first ever IIS tour.  The Web Administration Summit hit 10 countries in just about 4 to 5 weeks and was a absolute awesome experience, with a privilege to interact with so many of our talented customers.  The real thanks goes to Eric Woersching (IIS Product Manager) and Olga Londer (IT Pro Evangelism Manager) for putting this awesome experience together.

Lets cut to the chase - the beauty of this trip is that I learned that our hard work in over here (i.e. Redmond, Wa) doesn't always travel.  There are flights and ships, but nonetheless, no one seems to carry the message pver the big pond.  I hope to help change this small, very small technology problem for IIS customers and find a sufficient, reliable carrier for our message.  UPS or FedEx, you game?  Yes, I purposely left out United States Postal Service because of my "requirement" of reliable...Sorry postal folks, truth hurts!

In this trip, Wade, Alexis and I used a number of cool tools that the right side of the pond (i.e. Atlantic) hadn't heard of.  The kudo's goes to Netherlands for rocking the house and having the "best" in class in the tools "whereabouts" category...

During the trip, several customers asked for my scripts or tools that I used.  This is the purpose of tonights post is to help deliver on my promises - todays focus:  WCAT.

WCAT Controller

The biggest complaint I have about WCAT, oh legal name is Web Capacity Analysis Tool, is the fact that out of the box it seems more complicated than it is.  This is caused by the fact that there is this Controller piece and this Client.  It isn't as complicated as it seems as logistically I just draw a similarity to the 'ole Mainframe world of a dummy client and smart server.  It (WCat) is built on this principle.

The Controller, wcctl.exe, is the "brain" or the smart server.  It is responsible for telling the configurable # of clients what the heck they are supposed to do.  That is to say, wcclient.exe doesn't have the first clue unless the controller sends 'em instructions.  This is done by specifying that the controller load a particular UBR file.  Yeah, UBR... Sounds like Fubar.

Later on, I will show you a pretty cool way to make that UBR file much easier for  you non-JavaScript fans.  But, this should give you the "out of the box" experience for WCAT.

WCAT Client

As we mentioned, clients are nothing more than just a "dummy" doing what the "master" (wcctl.exe) tells it what to do.  Thus, all the requests that this client will make are completely dependent on the UBR settings.

Wcclient isn't fancy, just a .exe that you must call to start a client.  Based on your UBR configuration, the client will "simulate" a number of clients like setting the Client Threads to 80 equals 80 virtual clients.

The beauty of WCAT is that it can simulate a large number of clients and create very quick web traffic against your web server.  The downside is it doesn't have any built-in logic to determine what constitutues a "complete" request such as requests for images, htm, css's, and many other files that make up a typical web request.  See HTTP RFC for more details...

Using Log Parser to Generate a UBR File

Knowing what we know above, we first think "sheesh, if it can't re-create load already hitting my application then it is useless."  I would agree if it wasn't for a very cool tool called Log Parser (all you roadshow attendees you should be very familiar with this awesome tool!) that allows Log Parser to read your IIS Log Files and re-create that traffic against your server.  Did we just say that you can easily "re-create" your traffic?  You betcha... and free!

Log Parser:  Get The Coolness Here

To understand how to do this, I suggest that you review the following:

MS.COM Blog on Technet

Simplify your life...

During our trip, I used WCAT 5.2 in a couple of presentations.  The first, Managing IIS 6.0 in the Enterprise, where I showed how to use the Trace Diagnostics 1.0 (part of the IIS Diagnostics Toolkit) to view currently executing requests.  I simply created a simple UBR that would call an ISAPI filter that simulated a long running request, convienantly called "sleeper.dll."  My UBR file looked like the following:

Hang.ubr:

[Configuration]
WarmupTime                  2s
NumClientMachines        1
MaxRecvBuffer               64k
CooldownTime               5s
ThinkTime                      4s
NumClientThreads          80
Duration                         120s
Comment                        Make a Hang Occur

[Performace]

[Script]

NEW TRANSACTION
   classid = 2000000
   weight = 100
   NEW REQUEST HTTP
       URL = http://sitename/sleeper.dll?20000

 

In my case, I made my life simple (for all y'all in attendence) by making an easier command to issue.  In this case, I created a couple of easy CMD files called the following:

CONTROLLER.CMD
title WCAT Controller
wcctl -z %1 -a [HostName]

CLIENT.CMD
 

title WCAT Client
wcclient [HostName]

At this point, life is pretty easy especially if you have multiple scenarios to test.  In this case, I issue a couple of simple commands (in this case, on the same machine) to initiate the load against my web application:
[Server]
CONTROLLER.CMD HANG.UBR

[Client(s)]
CLIENT

Summary

WCAT is useful, needed free tool that allows a IT Admin or Developer ensure that an application performs as expected, especially under load.  Because I am passionate about IT Professionals and their ability to do their jobs (with sometimes little help from developers), I fight with folks all the time saying:  Test, Test, and Test again.  Developers are never completely sure what "load" is really occuring on the server, IT Pros are!  Use your IIS logs, your tools (like Log Parser or a paid log parsing application) tell the story.  WCat can be one of them...

Comments

Chirs,

the URL to "WCAT Blog on Technet" has been returning " unable to serve your request" for a couple of weeks

Sep 08 2006 by twarren

Hey T~

I appreciate you letting me know.  In fact, I need to update this blog a bit to ensure that it was effectively accurate as I included a .js script that only works on the newest version of WCat not yet released.  I also was able to fix that link that goes to the correct blog I meant to take it too when writing it!  Thanks for the heads up!

~Chris

Sep 08 2006 by chrisad

Is it possible simulate requests to website with forms authentication ?

Jul 28 2008 by Anonymous

Hi i am pretty new to WCAT and needed some help on the following issue....

I am unable to get the value of the set performance counters on the output log.My sample.ubr file looks like this:

########################################################

[Configuration]

WarmupTime  5s

NumClientMachines 1

MaxRecvBuffer  64K

CooldownTime  5s

ThinkTime  0

NumClientThreads 50

Duration  60s

Comment   512 byte keep-alive

[Performance]

Memory\Available KBytes

System\Context Switches/sec

System\System Calls/sec

System\Processes

System\Processor Queue Length

Processor(_Total)\% Processor Time

Processor(_Total)\% Priviledged Time

Processor(_Total)\% User Time

Web Service(_Total)\ Bytes Received/sec

Web Service(_Total)\ Bytes Sent/sec

Web Service(_Total)\ Connection Attempts/sec

Web Service(_Total)\ Get Requests/sec

[Script]

SET KeepAlive = TRUE

# Default Request Headers

NEW TRANSACTION

classId = 1

NEW REQUEST HTTP

URL = "/MSPetShop/SignIn.aspx"

NEW TRANSACTION

classId = 2

NEW REQUEST HTTP

URL = "/MSPetShop/Category.aspx"

[Distribution]

1 50

2 50

###########################################

Where do i need to mention the machine name or the IP address of the server for the WCAT to understand whose performance is to be monitored??Do i need to do any settings on the perfmon?

My output log file wcctl.log.log shows the following on running the above script

###########################################

WCAT Version         = 5.2

ConfigFile           =

ScriptFile           =

DistribFile          =

PerfCounterFile      =

LogFile              = wcctl.log.log

Author               =

Creation Date        =

Test Run Date        = Thu Jul 15 14:56:04 2010

Comment              = 512 byte keep-alive

Server [IpAddr]      =  [.....]

Clients              = 1

Threads              = 50

Buffer Size          = 65536 bytes

Duration             = 60 seconds (Warmup 5 seconds, Cooldown 5 seconds)

Results:

                       Data, Summary, Rate, 127.0.0.1

                  Client Id,          0,       0.00,      1,

                   Duration,         60,       1.00,     60,

         Total Transactions,       6671,     111.18,   6671,

             Total Requests,      27122,     452.03,  27122,

            Total Responses,      26686,     444.77,  26686,

               Total 200 OK,       6235,     103.92,   6235,

         Total 30X Redirect,       6530,     108.83,   6530,

     Total 304 Not Modified,          0,       0.00,      0,

        Total 404 Not Found,          0,       0.00,      0,

     Total 500 Server Error,          0,       0.00,      0,

          Total Misc Status,      13921,     232.02,  13921,

         Redirect Responses,          0,       0.00,      0,

          Avg Response Time,         52,       0.87,     52,

          Min Response Time,          0,       0.00,      0,

          Max Response Time,       1641,      27.35,   1641,

       StdDev Response Time,         91,       1.52,     91,

             Total Connects,      14377,     239.62,  14377,

           Avg Connect Time,         26,       0.43,     26,

           Min Connect Time,          0,       0.00,      0,

           Max Connect Time,       3453,      57.55,   3453,

        StdDev Connect Time,        171,       2.85,    171,

             Connect Errors,         72,       1.20,     72,

             Receive Errors,          0,       0.00,      0,

                Send Errors,        436,       7.27,    436,

     Internal Memory Errors,          0,       0.00,      0,

          No Headers Errors,          0,       0.00,      0,

      No Status Code Errors,          0,       0.00,      0,

          Bad Status Errors,      20451,     340.85,  20451,

 Bad Response Header Errors,          0,       0.00,      0,

   Bad Response Data Errors,          0,       0.00,      0,

No Redirect Location Errors,          0,       0.00,      0,

Bad Redirect Location Errors,          0,       0.00,      0,

                  Data Read,   73923911, 1232065.18, 73923911,

               Header Bytes,    5600192,   93336.53, 5600192,

                Total Bytes,   79524103, 1325401.72, 79524103,

        Avg Header per Page,        839,      13.98,    839,

         Avg Bytes per Page,      11920,     198.67,  11920,

Performance Counters:

                                   CounterName,     Average,   Avg per Page

                       Memory\Available KBytes,         0.00,       0.00

                   System\Context Switches/sec,         0.00,       0.00

                       System\System Calls/sec,         0.00,       0.00

                              System\Processes,         0.00,       0.00

                 System\Processor Queue Length,         0.00,       0.00

            Processor(_Total)\% Processor Time,         0.00,       0.00

          Processor(_Total)\% Priviledged Time,         0.00,       0.00

                 Processor(_Total)\% User Time,         0.00,       0.00

       Web Service(_Total)\ Bytes Received/sec,         0.00,       0.00

           Web Service(_Total)\ Bytes Sent/sec,         0.00,       0.00

  Web Service(_Total)\ Connection Attempts/sec,         0.00,       0.00

         Web Service(_Total)\ Get Requests/sec,         0.00,       0.00

            Files Requested,      27122,     452.03,  27122,

                 Files Read,       6235,     103.92,   6235,

Per Class Statistics:

                  1 Fetched,       6457,     107.62,   6457,

                  1 Errored,       7042,     117.37,   7042,

                  1 distrib,       4977,      82.95,   4977,

                  2 Fetched,        214,       3.57,    214,

                  2 Errored,      13409,     223.48,  13409,

                  2 distrib,       5022,      83.70,   5022,

###################################################

As you see the Performance Counters value is 0.00. Please suggest a solution......

Jul 15 2010 by sutapashome