Friday, 13 June 2014


Web logs and historical traffic analysis may give you insight into the kind of traffic you can expect over time, but how can you tell what your infrastructure can really handle? To find out, you need a tool that can push your infrastructure and its application stack to the breaking point. One such tool is the free Web Capacity Analysis Tool (WCAT), a lightweight load-generation utility that plays back scripted HTTP requests against a Web server (or load-balanced server farm) while gathering performance statistics for later analysis. The latest version (6.3.1 as of this writing) is available for both x86 and x64 Windows systems(x86:iis.net/downloads/1466/ItemPermaLink.ashx; x64: iis.net/downloads/1467/ItemPermaLink.ashx) and has support for IPv6 networks. 

I simulate this with my Webserver and found the below result.

Web Capacity Analysis Tool – WCAT : 


Purpose:

Web Capacity Analysis Tool (WCAT) is a lightweight HTTP load generation tool primarily designed to measure the performance of a web server within a controlled environment. WCAT can simulate thousands of concurrent users making requests to a single web site or multiple web sites. The WCAT engine uses a simple script to define the set of HTTP requests to be played back to the web server. Extensibility is provided through plug-in DLLs and a standard, simple API.

HTTP.sys Cache:

Microsoft introduced Kernel-mode caching in IIS 6.0.This feature elimantes the need for accessing User-Mode cache in many cases.The HTTP.sys cache helps increase server performance and reduces the disk cost.
You can config frequentHitTimePeriod and frequentHitThreshold in the serverRunTime applicationHost.config section.Here are the default serverRunTime settings in the \Windows\System32\inetsrv\config\schema folder.
<sectionSchema name="system.webServer/serverRuntime">
    <attribute name="enabled" type="bool" defaultValue="true" />
    <attribute name="appConcurrentRequestLimit" type="uint" defaultValue="5000" />
    <attribute name="maxRequestEntityAllowed" type="uint" defaultValue="4294967295" />
    <attribute name="uploadReadAheadSize" type="uint" defaultValue="49152" validationType="integerRange" validationParameter="0,2147483647" />
    <attribute name="alternateHostName" type="string" />
    <attribute name="enableNagling" type="bool" defaultValue="false" />
    <attribute name="frequentHitThreshold" type="uint" defaultValue="2" validationType="integerRange" validationParameter="1,2147483647" />
    <attribute name="frequentHitTimePeriod" type="timeSpan" defaultValue="00:00:10" />
    <attribute name="authenticatedUserOverride" type="enum" defaultValue="UseAuthenticatedUser">
      <enum name="UseAuthenticatedUser" value="1" />
      <enum name="UseWorkerProcessUser" value="2" />
    </attribute>
  </sectionSchema>

A request is cached of more than the number of frequentHitThreshold request for a cacheable URL arrives within the frequentHitTimePeriod settings.

The examples shows how to setup Web Capacity Analysis Tool –WCAT and run the WCAT controller,WCAT Client, and setup output caching polices in IIS manager.


  •         Download the WCAT tool and install.

  •        Create a folder named C:\LoadTest to hold the configuration files.

  •        Create a file called Default.aspx in C:\LoadTest. Type <% =DateTime.Now() %> and save Default.aspx.The file will be used for load testing.

  •         Create a new file called script.cfg in C:\LoadTest and Type the following text:

NEW TRANSACTION
            classId = 1
          NEW REQUEST HTTP
                        Verb = “GET”
                        URL = http://localhost/Default.aspx

5.      Create a file called distribution.cfg and type the following text inside the file
1 100
6.      Create a file called config.cfg and type the following text inside the file:
Warmuptime 5s
Duration 30s
cooldownTime 5s
NumClientMachines 1
NumClientThreads

Next, After you have configured the LoadTest folder and supporting WCAT files, you can enable the WCAT controller.

Open a command prompt and type the following syntax:

Cd \LoadTest
%Program Files%\ IIS Resources\WCAT Controller\wcctl” –c config.cfg –s script.cfg –d distribution.cfg –a localhost

After enabling the WCAT controller, you can run the WCAT Client to performance tests.

Open another command prompt window to start the WCAT client.
%Program Files%\ IIS Resources\WCAT Controller\wcclient.exe” localhost

The first test has no output cache policy enabled.You can set the output caching policy in IIS Manager. Below screenshot shows no output cache policy enabled.

The second test enables User-mode policy only.The test using user-mode policy assumes you are using the file notifications option displayed in the below screenshot also shows how to enable a user-mode cache policy,

No Output cached policy enabled:



User -Mode cache policy : 



As you can see the result in below, After running a test with User-mode caching enabled, the results are 656 requests per second, which is a 13 percent increase over no cache policy enabled.
For the third test, disable the user-mode caching policy and enable Kernal-mode caching.The Kernal-mode caching.The kernel-mode caching test assumes you are using the file notification option displayed in below screenshot shows how to configure a kernel-mode caching policy.

Kernel-mode cache Policy



After running the test with kernel-mode caching enabled, the results are 946 per second, which is 60 percent more than if you had no cache policy.Below results from the three permonance tests.The results can vary depending on what type of hardware you are using.

Test Results :


Request per second
Cache Level
575
No cache enabled
656
User-mode caching only
946
Kernal-mode caching only




No comments:

Post a Comment