locked
Help stress testing PHP with WCAT 6.3 RRS feed

  • Question

  • User-95264152 posted

    I am trying to figure out how to use WCAT to to stress testing on a PHP script. I basically want to see how many requests the server can handle with various configuration scenarios, to see what works best for my setup.

    This is what I have pieced together so far. I've created a batch file to run

    start_wcat.bat

    wcat.wsf -terminate -run -clients localhost -t scenario.ubr -f settings.ubr -extended

     

    The 2 config file loaded are as follows:

    settings.ubr

    settings
    {
     server         = "127.0.0.1";
     clients        = 1;
        virtualclients = 20;

        counters
        {
            interval = 10;

            counter = "Processor(_Total)\\% Processor Time";
            counter = "Processor(_Total)\\% Privileged Time";
            counter = "Processor(_Total)\\% User Time";
            counter = "Processor(_Total)\\Interrupts/sec";

            counter = "Memory\\Available KBytes";

            counter = "Process(w3wp)\\Working Set";

            counter = "System\\Context Switches/sec";
            counter = "System\\System Calls/sec";

            counter = "Web Service(_Total)\\Bytes Received/sec" ;
            counter = "Web Service(_Total)\\Bytes Sent/sec" ;
            counter = "Web Service(_Total)\\Connection Attempts/sec" ;
            counter = "Web Service(_Total)\\Get Requests/sec" ;
        }
    }

     

    scenario.ubr

    scenario
    {
        warmup      = 5;
        duration    = 20;
        cooldown    = 5;
     
     default
     {
      setheader
      {
       name = "Connection";
       value = "keep-alive";
            }
        }

        transaction
        {
            id = "Test1";
            weight = 1;

            request
            {
                url         = "/forums/index.php";
            }
      request
            {
                url         = "/forums/viewforum.php?f=2";
            }
        }
    }

     

    when I run the start_wcat.bat file it opens to command prompts with no errors and seems to proceed running the test. But i don't think its working correctly, the output statistics seem weird, and my data from perfmon seems really low and only displays during what seems the warmup period.

    Isn't 4 requests/sec really really bad? This is a brand new Quad core with 4GB of ram.

    I don't know why all the values are 0?

    So I know i'm doing something wrong, but I cna't figure it out. I ahve also tried launching WCAT directly, but it has the same results as above.

    client.bat

    wcclient localhost

    controller.bat

    "C:\Program Files\wcat\wcctl" -t scenario.ubr -f settings.ubr -x -l

    Wednesday, July 9, 2008 7:29 PM

Answers

  • User844605415 posted

    You shouldn't compare numbers from different hardware because it can churn requests faster or slower depending on it's computing speed. If you plan on doing basic testing you can use WCAT 5.2 but we would recommend using the latest. Here is a sample WCAT 6.3 client file, modify the URL as appropriate,

    scenario
    {
        name = "helloworld";

        warmup = 180;
        duration = 180;
        cooldown = 30;

        default
        {
     setheader
     {
         name    = "Connection";
         value   = "keep-alive";
     }
            setheader
            {
                name    = "Accept";
                value   = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, */*";
            }
            setheader
            {
                name    = "Accept-Language";
                value   = "en-us";
            }
            setheader
            {
                name    = "User-Agent";
                value   = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0";
            }
            setheader
            {
                name    = "Accept-Encoding";
                value   = "gzip, deflate";
            }
            setheader
            {
                name    = "Host";
                value   = "webcat";
            }
            version     = HTTP11;
            statuscode  = 200;
            close       = ka;
        }

        transaction
        {
            id = "helloworld";
            weight = 100;
            request
            {
                url = "/helloworld/helloworld.php";
            }
        }
    }

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, July 10, 2008 2:31 AM

All replies

  • User844605415 posted

    Hi,

    You seem to be running wcat correctly, though I would recommend you running it on a different machine from the server under stress.

    Having said that, you have 2 URL's in your only transaction, every wcat virtual client will sequentially execute the URL's in this transaction. So from the information in this thread the second URL seems to be taking some time(or is stuck) to come back. Can you remove this URL and see if you can get rid of all 0's that you are seeing?

    Also what is the CPU utilization you are seeing?

    Thanks,

    Mukhtar Desai

    IIS Performance Team

    Wednesday, July 9, 2008 8:21 PM
  • User-95264152 posted

    I did what you said and took out the 2nd request from my scenario.ubr.

    My CPU usage while the WCAT test is running is at 100%.

    I am still only getting 4/sec in the output and the last output is still all 0's. I have no idea what's going on.

     

    I have downloaded the older WCAT 5.2 and i'm having more luck with it, the UBR config syntax is a different format but I am now able to get actual results with it.. i think. Since the controller and the client both have outputs, which one should I be looking at? The numbers are close but not the same.

    This is my UBR for WCAT 5.2, I am testing a default phpbb3 app.

    [Configuration]
    WarmupTime  10s
    NumClientMachines 1
    MaxRecvBuffer  64K
    CooldownTime  5s
    ThinkTime  0s
    NumClientThreads 80
    Duration  30s
    Comment   Test Server

    [Performance]

    [Script]
    SET KeepAlive = TRUE

    NEW TRANSACTION
     classId = 1
     weight = 100
     server = "localhost"
         NEW REQUEST HTTP
             URL = "/forums/index.php"

    Wednesday, July 9, 2008 10:46 PM
  • User844605415 posted

    Hmmm..regards to CPU utilization, which process is consuming the most, w3wp, php-cgi, wcclient or wcctl? You can look it up in task manager. 

    I'm not sure what index.php is doing, but can you try to stress a simple helloworld.php page with the following script,

    <?php echo'hello world' ?>

    In your WCAT 5.2 client file you have 80 virtual clients against your 20 from WCAT 6.3, so in theory it should fare 4 times better. Regards to what number you should be looking at, you should be looking at the log file that the controller generates. The output log file will only contain data for the actual duration of your run, so it will not contain data for warmup or coooldown.

    Thanks,

    Thursday, July 10, 2008 12:00 AM
  • User-95264152 posted

    Strange I made a script called test.php with the hello world as you suggest, then re-ran WCAT 5.2

     All the requests are "Bad requests", there are no "200 OK" requests for some reason. I tested the test.php in a browser it works fine and its sitting in the sites root.

    URL = "/test.php"

    As for CPU usage, seems WCAT itself takes a lot, so I will try install the client on another computer on the network once its working properly to get more accurate results.

    using a plain test.html file works, but I want to test PHP.

    for a plain html file the values are pretty high. (Total 200 OK,     224114,    7470.47)

    Does anyone have a sample UBR file they use?

    Thursday, July 10, 2008 12:48 AM
  • User-95264152 posted

    I seemed to have fixed the bad requests (500) problem. I had to manualy edit the applicationHost.config to add the PHP_FCGI_MAX_REQUESTS variable.

    This is the post that helped me: http://forums.iis.net/p/1149114/1868558.aspx#1868558

    It would be interesting and helpful if someone else could run the same WCAT test on there server, to compare values. I ran the client from a computer on the local client for these tests.

     

    <?php echo 'hello world'; ?>

    • PHP FastCGI
    • Total Requests: 6966
    • Per Second: 232
    •  
    • PHP FastCGI w/ Output Caching  
    • Total Requests: 7197
    • Per Second: 239

     

    phpbb3(fresh install) viewtopic.php?t=1

    • PHP FastCGI
    • Total Requests: 1046
    • Per Second: 35
    • PHP FastCGI w/ Output Caching
    • Total Requests: 12549
    • Per Second: 418

     

    I guess if WCAT 5.2 is working, there isn't any need to figure out why WCAT 6.3 won't work. Unless there are some improvements in the v6.3 that are worth while.

    Thursday, July 10, 2008 1:47 AM
  • User844605415 posted

    You shouldn't compare numbers from different hardware because it can churn requests faster or slower depending on it's computing speed. If you plan on doing basic testing you can use WCAT 5.2 but we would recommend using the latest. Here is a sample WCAT 6.3 client file, modify the URL as appropriate,

    scenario
    {
        name = "helloworld";

        warmup = 180;
        duration = 180;
        cooldown = 30;

        default
        {
     setheader
     {
         name    = "Connection";
         value   = "keep-alive";
     }
            setheader
            {
                name    = "Accept";
                value   = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, */*";
            }
            setheader
            {
                name    = "Accept-Language";
                value   = "en-us";
            }
            setheader
            {
                name    = "User-Agent";
                value   = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0";
            }
            setheader
            {
                name    = "Accept-Encoding";
                value   = "gzip, deflate";
            }
            setheader
            {
                name    = "Host";
                value   = "webcat";
            }
            version     = HTTP11;
            statuscode  = 200;
            close       = ka;
        }

        transaction
        {
            id = "helloworld";
            weight = 100;
            request
            {
                url = "/helloworld/helloworld.php";
            }
        }
    }

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, July 10, 2008 2:31 AM
  • User-95264152 posted

    thanks, that seems to work better. The test seemed to have run and I guess the nice XML output is one reason to use v6.3. The "Requests/sec" result is almost the same as i got with 5.2 for the helloworld (233/sec).

     

    With the WCAT 5.2 I ran the helloworld on my new server and on my old server. And its concerning that the old server, which is currently in use and running 50 sites, gets high values than my new server. I changed IIS7 to use PHP via ISAPI since thats what the old server uses, to compare.

    New Server (Windows 2008/IIS7, Quad Core X3220, 4GB ram)

    • PHP ISAPI
    • Total Requests: 6674
    • Per Second: 222

    Old Server (Windows 2003/IIS6, Dual CPU Xeon 2.4Ghz, 2GB ram)

    • PHP ISAPI
    • Total Requests: 16885
    • Per Second: 562

    I thought windows 2008 with IIS7 would result in better performace, it's one of the main reasons I upgraded. The new server is also a fair bit faster hardware. So why does my old server, which is also under load, get better results?

    Thursday, July 10, 2008 2:54 AM
  • User844605415 posted

    There are lot of variables here - different OS, different hardware. The recommended way of doing this is to install Windows 2003 on your quad core box and get the baseline number, I do understand that this might not be feasible. When trying to gauge performance impact it is always better to change one thing at a time.

    I don't know about PHP ISAPI but running the above helloworld test using FASTCGI gives comparable numbers on both Windows 2003 and 2008 - of course on the same hardware.

    Thursday, July 10, 2008 3:22 PM
  • User-1341446551 posted

    I was just testing PHPBB3 myself so thought you guys should know he results as well:

    OS: Windows Server 2008  Enterprise SP1

    Configuration: Quadcore, 4 GB RAM

    Environment: IIS, ASP.NET and MYSQL

    PHPBB3 - PHP without FastCGI:(/forums/index.php)

    Request\Sec: 2 :( :( :( :(

    PHPBB3 - PHP with FastCGI:(/forums/index.php)

    Request\Sec: 19

     PHPBB3 - PHP with FastCGI and Output Caching:

    Request\Sec: 2638

     That's like a 140 time increase... M I doing it right ... :) :D

    My .cfg files are as follows: (WCAT 5.2)

    Script.cfg

    NEW TRANSACTION
        classid = 1
        NEW REQUEST HTTP
        Verb = "GET"
        URL = "http://ip/forums/index.php"

    Config.cfg

    Warmuptime 5s
    Duration 30s
    Cooldowntime 5s
    NumClientMachines 1
    NumClientThreads 20

    Distribution.cfg

    1 50

    Thursday, January 7, 2010 5:29 PM
  • User467144166 posted

     Hi everybody,

    I try to using WCAT 5.2 with parameter post, protocol ssl. I set RequestData = <search.txt> ; RequestHeader = "Content-Type: application/x-www-form-urlencoded\r\nContent-Length: 41098 \r\n". And I copy the searchData.txt to wcatClient and wcatServer. However, when I execute :


    - server     wcctl -c config.txt -d distribution.txt -s script.txt -a localhost
    - client     wcctl localhost

    However, it's throw exception : 400 - header

    So, would you please have your idea about this isse?

     

    Thanks a lot for your help,

    Jack.
    Thursday, January 21, 2010 4:19 AM
  • User-1969512040 posted

    Do you know how to install phpBB3 forums on IIS? I have php already installed on my IIS system but cannot get phpBB3 to work when I tried installing it on my server.  thanks

    Sunday, May 9, 2010 12:51 AM
  • User1044555260 posted

    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......

     

    Thursday, July 15, 2010 8:23 AM
  • User463223243 posted

     Hi , can some one help me.

     

    I have installed WCAT 6.2 post installation i am not able to locate  " scenario.ubr" file.

     

    I am trying this 1st time , please share if any step and sequence of command which need to follow.

    Wednesday, April 27, 2011 12:51 AM
  • User-1672167363 posted

    Hello,

    This is an old post and has not been getting updated replies for new questions.

    If your still having problems with this the "scenario.ubr" file does not come as part of the WCAT installation.

    A) There are examples in the scripts folder that can be used to create a "scenario.ubr". 

    B) The "scenario.ubr" contains commands  and sections tailored for getting a particular test run.

    C) If you open the existings files in the WCAT scripts folder with notepad you will see the

          required commands and sections.

    D) If you create a new file from notepad named "scenario.ubr" you can use the information from the post

          and WCAT Documentation to create a simular "scenario.ubr" script file.

    Then after you have created the new custom "scenario.ubr" you can check your Web Site. 

    Martin

     

     

     

    Friday, May 20, 2011 1:57 PM