We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

WCAT 6.3 is not setting or adding cookies to header when server is ApacheRSS

4 replies

Last post Oct 29, 2009 03:25 PM by DirkTester

  • WCAT 6.3 is not setting or adding cookies to header when server is Apache

    Oct 27, 2009 03:18 PM|DirkTester|LINK

    Greetings, 

    [NOTE: I now realize that I mis-categorized this post - probably should have placed it under the "General" performance or tool troubleshooting sections.]

    One of our environments is configured to run an instance of Drupal (.php) on an Apache web server. 

    When using WCAT  (Web Capacity Analysis Tool) to execute requests, I've noticed that each request to the web server (even multiple requests in the same transaction) are treated as a unique session.  Using Microsoft Network Monitor, I've verified that non of the requests include the expected Cookie in the header.

    When I use a browser (IE) to manually execute requests against the same environment, the network monitor confirms that Cookies are included in all requests after the initial request is made.

    I've successfully used WCAT against another of our environments, which runs IIS 6 (.net based site): cookies are set and included in request headers. 

    The WCAT 6.3.1 User's Guide contains the following text: "...The web server software can be any version of IIS, Apache, etc… as long as it is an HTTP compliant web server..."

    Do you have any idea why WCAT may not be setting cookies properly when the web server is Apache (which is consistent with the WCAT Users's Guide)?  Could it be somehow related to the page being .php?

    ...Dirk

    WCAT Apache cookies .php header http request

  • Re: WCAT 6.3 is not setting or adding cookies to header when server is Apache

    Oct 28, 2009 12:30 AM|cpattekar|LINK

    Hi Dirk,

    Can you please share the WCAT client ubr file?

  • Re: WCAT 6.3 is not setting or adding cookies to header when server is Apache

    Oct 28, 2009 12:55 PM|DirkTester|LINK

    OK.  Here is a sample of a client script, edited for the sake of this debugging effort.  I verified that this same script reproduces the missing cookies in the header when making a request from our Apache environment (.php site).  However, this same script works as expected (including cookies in header) when I point it at a different environment that is running IIS 6 (.net site).

    For the sake of this test, the settings.ubr script is throttled way back: clients=1; virtualclients=1

    As noted by the comments in the client script, I added a delay to further reduce unnecessary traffic.

    Here are the steps I have been using to help reproduce and isolate the issue:

    1. <div mce_keep="true">Configure Microsoft Network Monitor's capture filter: capture only traffic to/from the IP address of the target environment; capture only HTTP protocol traffic.</div>
    2. <div mce_keep="true">Configure the settings script for minimal load: clients=1; virtualclients=1.</div>
    3. <div mce_keep="true">Execute WCCTL (pointed at the client.ubr and settings.ubr).</div>
    4. <div mce_keep="true">Execute WCCLIENT </div>
    5. <div mce_keep="true">The client script is only 10 second and it will only complete a few iterations: stop the network monitor and inspect the frame details, particularly the "HTTP:Request, GET /" </div>

    RESULT: For any given iteration, the request header does not include cookies. As noted by comments in the client script, the second request should have a cookie in the header.  When the same script is pointed at an IIS 6 environment, the expected cookies appear in the header when the second request in the transaction is made.

    Here is a sample snippet of the header when WCAT is pointed at Apache:

    - Http: Request, GET /
        Command: GET
      + URI: /?second_request
        ProtocolVersion: HTTP/1.1
        TESTER:  testing testing
        Accept-Encoding:  gzip, deflate
        Accept-Language:  en-us
        Accept:  */*
        Host:  tigard.katu.com
        Connection:  keep-alive
        HeaderEnd: CRLF

    Here is a sample snippet of the header when WCAT is pointed at IIS 6.  For the sake of this posting, I manually truncated most of the text that appeared in the Cookie header, signified by the "[...]":

       - Http: Request, GET /
        Command: GET
      + URI: /?second_request
        ProtocolVersion: HTTP/1.1
        TESTER:  testing testing
        Accept-Encoding:  gzip, deflate
        Accept-Language:  en-us
        Accept:  */*
        Host:  awio1
        Connection:  keep-alive
        Cookie:  sess_last=10/28/2009 [...];
        HeaderEnd: CRLF

    //////////////////////////////////////////////////////////////////////////////////// 

    scenario
    {
        name    = "Home Page";

        warmup      = 5;
        duration    = 10; //seconds
        cooldown    = 5;

        default
        {
            setheader
            {
                name    = "Connection";
                value   = "keep-alive";
            }
            setheader
            {
                name    = "Host";
                value   = server();
            }
            setheader
            {
                name    = "Accept";
                value   = "*/*";
            }
            setheader
            {
                name    = "Accept-Language";
                value   = "en-us";
            }
            setheader
            {
                name    = "Accept-Encoding";
                value   = "gzip, deflate";
            }
            addheader
            {
                name    = "TESTER";
                value   = "testing testing";
            }

            version = HTTP11;

    //by default, cookies is set to true
     cookies =true;
     close = ka;
        }

    transaction
    {
            id = "default page";
            weight = 100;

    // clear any pre-existing cookies for virtual user.
     cookies
     {
      clear = true;
     } 
    // Given the clear cookie element (above),
    // no cookie expected in header of first request.
     request
     {
      url         = "/?first_request";
      statuscode  = 200;
     }
     
    // EXPECT cookie to appear in the following request header:
     request
     {
      url         = "/?second_request";
      statuscode  = 200;
     }

    // DELAY added to help throttle iterations/requests.
     sleep
     {
      delay = 3000;
     }

        }

    }

    ////////////////////////////////////////////////////////////////////////////////////

  • Re: WCAT 6.3 is not setting or adding cookies to header when server is Apache

    Oct 28, 2009 02:11 PM|DirkTester|LINK

    In the previous post, I reference the use of Microsoft Network Monitor in the repro steps. 

    For debugging WCAT scripts (among other things), it seems like some sort of network monitor is essential. Microsoft Network Monitor 3.3 does a great job and is easy to use.  Simply create/paste the Capture filter...press the Apply button...then Start the monitor.

    In case somebody isn't familiar with configuring Microsoft Network Monitor, here is a sample script that can be used to capture only HTTP traffic to/from your target web site.  The application should be installed on the client machine that is being used to make the requests.

    //////////////////////////////////////////////////////////////

    IPv4.Address == [your site's IP]    //i.e. 11.222.33.444
    AND
    HTTP  //capture only HTTP traffic

    //////////////////////////////////////////////////////////////

    ...Dirk

  • Re: WCAT 6.3 is not setting or adding cookies to header when server is Apache

    Oct 29, 2009 03:25 PM|DirkTester|LINK

    Greetings, 

    After futher investigation, I found that this issue isn't limited to Apache (.php).  I was also able to reproduce the issue by pointing the WCAT client script (above) at some other sites that use IIS 6.     NOTE: during the investigation, I kept the delay in the script to help keep the load to a minium.

    At this point, there is something about the WCAT request that prevents it from either getting/accepting cookies from many web environments (Apache and IIS).  I tried experimenting with the various header informaiton, such as UserAgent, Accept-Encoding, etc...and tried to make a WCAT request appear as IE6, Firefox, etc.  Didn't work. 

    During the investigation, I found that I couldn't affect the "Connection" header.  Even when I specified close = "Reset" or "Graceful" in the client script, the header always contained,  "Connection:  keep-alive".  Regardless, I don't suspect this is the cause of the cookie issue.

    Finally, I tried a similar test using the old Microsoft Web Application Stress Tool (a.k.a. Homer, WAST, etc).  This tool did not have the problem with cookies: the second request made by WAST included the cookie in its request header. 

    If anybody has any other suggestions, let me know, but right now it seems like WCAT may have a bug regarding the setting/accepting of cookies. 

    ...Dirk