Oracle WebHammer User's Guide
Release 1.0.0.0.0

Part Number Z27029-01

Index

Go to previous page Go to next page

6
WebHammer Examples

This chapter provides examples of WebHammer. It contains the following sections:

Introduction

The following examples demonstrate the use of WebHammer.

The examples feature a server called edtcsun33, with an Apache Web server configured. The client is called iesun8. Both the server and the client run Sun Solaris Operating Environment and the TCP/IP Run Time System.

Simple GET Example

This simple GET example shows requests for static HTML content. The purpose of this test is to show how to set up the scenario file and use WebHammer.

Server Configuration

The following procedure creates test files on your server.

  1. Create a directory called testdir under /var/apache/htdocs.

  2. Run the following:

    mtktest
    
    

    In the testdir, the mktest shell script creates:

    test1.html
    .
    .
    .
    test1000.html
    
    
    

Client Configuration

The following procedure is an example of a client configuration.

  1. Create the template file. A template file contains the URL operations needed for your scenario file.

    A template file is shown below.

    GET /testdir/test{1}.html
    
    
    
  2. Create the data file.

    The data file is includes the data which replaces the text indicated with curly brackets {} in the template file to create the scenario file. The following is a sample of the information in the data_get file:

    1
    2
    3
    4
    5
    
    .
    .
    .
    999
    1000
    
    
  3. Create the scenario file.

    Using the template file and data file create the scenario file using the mkscenario command.

    iesun8 >  mkscenario  data_get  template_get  scenario_get
    
    
    

    The following is a sample of the information created from the file scenario_get. There are 1000 entries created in the scenario_get file because the data file includes 1000.

    GET /testdir/test1.html
    GET /testdir/test2.html
    GET /testdir/test3.html
    GET /testdir/test4.html
    GET /testdir/test5.html
    GET /testdir/test6.html
    GET /testdir/test7.html
    .
    .
    .
    GET /testdir/test1000.html
    
    
    

    The scenario file can also be created with a specific number of entries and those entries can be created in a random sequence. The following example demonstrates creating a random sequence of 5,000 entries in the scenario file from data file which contains 1,000 entries. Note that some entries are duplicated.

    iesun8 > mkscenario  -r  -p 5000 data_get  template_get scenario_get
    
    

    The following is a sample of the information created from the file scenario_get. There are 5,000 entries in the scenario_get file derived from the 1,000 entries in the data file.

    GET /testdir/test495.html
    GET /testdir/test320.html
    GET /testdir/test792.html
    GET /testdir/test916.html
    
    GET /testdir/test794.html
    GET /testdir/test818.html
    GET /testdir/test695.html
    GET /testdir/test444.html
    GET /testdir/test283.html
    GET /testdir/test677.html
    GET /testdir/test663.html
    GET /testdir/test421.html
    
    
  4. Run an initial trial test.

    Before running a full test, run a trial test to ensure your setup is correct.

    Run the trial test using verbose level 3. Level 1 shows the actual data sent to the server and level 2 shows the data received from the server. Level 3, which is levels 1 and 2 combined, shows both the data sent to and the data received by the server. Inspect the response to ensure that the server has sent back the information expected.

    Use only one URL entry from the scenario file -n 1.

    Simulate the test using one user, -u 1:

    iesun8 > hammer -v 3 -n 1 -u 1 -p 80 -r edtcsun33 -o  log_get scenario_get
    
    

    The following is an example of a result when trace level 3 is enabled:

    
    Trace level=3
    Parsing scenario file "scenario_get"
    Started 1 users, start staggered by 10 msec, divided workload, each user 
    executes 1 URLs
    Please wait while workload completes...
    Starting user number [0]
    WRITE request data=[GET /testdir/test1.html]
    READ response data=[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
     <HEAD>
      <TITLE>Test Page for Apache Installation on Web Site</TITLE>
     </HEAD>
    <!-- Background white, links blue (unvisited), navy (visited), red (active) 
    -->
     <BODY
      BGCOLOR="#FFFFFF"
      TEXT="#000000"
      LINK="#0000FF"
      VLINK="#000080"
      ALINK="#FF0000"
     >
      <H1 ALIGN="CENTER">
       It Worked!  The Apache Web Server is Installed on this Web Site!
      </H1>
      <P>
    
      If you can see this page, then the people who own this domain have just
      installed the <A HREF="http://www.apache.org/">Apache Web server</A>
      software successfully.  They now have to add content to this directory
      and replace this placeholder page, or else point the server at their real
      content.
      </P>
      <HR>
      <BLOCKQUOTE>
       If you are seeing this page instead of the site you expected, please
       <STRONG>contact the administrator of the site involved.</STRONG>
       (Try sending mail to <SAMP>&lt;Webmaster@<EM>domain</EM>&gt;</SAMP>.)
       Although this site is
       running the Apache software it almost certainly has no other connection
       to the Apache Group, so please do not send mail about this site or its
       contents to the Apache authors.  If you do, your message will be
       <STRONG><BIG>ignored</BIG></STRONG>.
      </BLOCKQUOTE>
      <HR>
      <P>
      The Apache
      <A
    HREF="manual/index.html"
      >documentation</A>
      has been included with this distribution.
      </P>
      <P>
    
      The Webmaster of this site is free to use the image below on an 
    Apache-powered Web server.  Thanks for using Apache!
      </P>
      <DIV ALIGN="CENTER">
       <IMG SRC="apache_pb.gif" ALT="">
      </DIV>
     </BODY>
    </HTML>
    ]
    READ response data=[]
    1 url processed, 0 responses timed out
    Processing results to "log"
    
    
  5. Run the full test after the initial test is successful.

    The following example shows 20 users -u 20 submitting URL requests at an rate of 1 per second -t 1.

    By default, the workload is divided evenly among the threads or users unless the -c option is used in which case each user simultaneously executes the same complete workload.

    iesun8 >   hammer -h -t 1 -u 20 -p 80  -r edtcsun33  -o log_get scenario_get
    
    
    
  6. Interpret the test result.

    The results are output to a log file -o log_post.

    The results show summary information(-h) for a user and the individual URL operations executed by that user. For column information, see Table 3-1, "Default Results".

    The following example shows the results displayed with header information and includes the summary information for each user:

    [User no] User Time (msec): Bytes Rx
    [0] 10097: 16220
        [URL no] URL Time (msec): Bytes Rx: Requests: Timeouts: [URL]
        [0] 20: 1622: 1: 0: [GET /testdir/test1.html]
        [1] 7: 1622: 1: 0: [GET /testdir/test2.html]
        [2] 21: 1622: 1: 0: [GET /testdir/test3.html]
        [3] 16: 1622: 1: 0: [GET /testdir/test4.html]
        [4] 172: 1622: 1: 0: [GET /testdir/test5.html]
        [5] 262: 1622: 1: 0: [GET /testdir/test6.html]
        [6] 319: 1622: 1: 0: [GET /testdir/test7.html]
        [7] 341: 1622: 1: 0: [GET /testdir/test8.html]
        [8] 309: 1622: 1: 0: [GET /testdir/test9.html]
        [9] 200: 1622: 1: 0: [GET /testdir/test10.html]
    
    [User no] User Time (msec): Bytes Rx
    [1] 24086: 14598
        [URL no] URL Time (msec): Bytes Rx: Requests: Timeouts: [URL]
        [10] 12: 1622: 1: 0: [GET /testdir/test11.html]
        [11] 18: 1622: 1: 0: [GET /testdir/test12.html]
        [12] 8: 1622: 1: 0: [GET /testdir/test13.html]
        [13] 31: 1622: 1: 0: [GET /testdir/test14.html]
        [14] 164: 1622: 1: 0: [GET /testdir/test15.html]
        [15] 244: 1622: 1: 0: [GET /testdir/test16.html]
        [16] 303: 1622: 1: 0: [GET /testdir/test17.html]
        [17] 19999: 0: 0: 1: [GET /testdir/test18.html]
        [18] 20: 1622: 1: 0: [GET /testdir/test19.html]
    
        [19] 21: 1622: 1: 0: [GET /testdir/test20.html]
    
    

    The following example of the hammer command shows a request for results without header information.

    iesun8 >  hammer  -t 1 -u 20 -p 80  -r edtcsun33  -o  log_get  scenario_get
    
    

    Only information related to sending the actual URL operation is displayed. By default, headings and user summary information does not appear.

    If you are working with a large workload, you can display results with no header information results to make the results easier to interpret. Without header information, the results are exportable to a spreadsheet or database for analysis. If you are working with a large workload and display results without header information, your log file size is smaller.

    The following example shows the results displayed without header information. For column information, see Table 3-1, "Default Results" .

    
    0:23:1622:1:0
    1:161:1622:1:0
    2:242:1622:1:0
    3:358:1622:1:0
    4:426:1622:1:0
    5:1626:1622:1:0
    6:1199:1622:1:0
    7:276:1622:1:0
    8:29:1622:1:0
    9:19:1622:1:0
    10:19:1622:1:0
    11:108:1622:1:0
    12:187:1622:1:0
    13:321:1622:1:0
    14:633:1622:1:0
    15:1592:1622:1:0
    16:1220:1622:1:0
    17:243:1622:1:0
    18:14:1622:1:0
    19:14:1622:1:0
    20:11:1622:1:0
    
    

POST Operation Example

This section includes information on how to set up an form-filing operation example which invokes an application on the server.

Consider the following screen in the a browser accessing 
http://edtcsun33/form.html


Text description of image2.gif follows.
Text description of the illustration image2.gif

The user fills in the information and clicks Send. Clicking Send starts a POST operation with all the information the user has provided to the server. The POST operation is then received by the server which executes the myscript shell script, displaying thanks.html. The server takes the information in the POST operation and outputs it to /tmp/output.

The example application performs a simple operation but you can use WebHammer to evaluate a complicated application involving such operations as inputting and retrieving information from a database on the server.

Server Configuration

To configure the server:

  1. Copy the following files to the /var/apache/cgi-bin directory:

    uncgi - CGI executable
    myscript	 - executable shell script
    
    
  2. Copy the following files to the /var/apache/htdocs directory:

    form.html
    thanks.html
    
    

Client Configuration

The following procedure is an example of a client configuration.

  1. Capture the scenario.

    Access the http://edtcsun33/form.html from your browser, fill in the form, and click Send.

    Using the sniffer tool of your choice, capture the HTTP request. A sniffer tool captures data packets.

    The following represents a capture of the scenario:

    POST /cgi-bin/uncgi/myscript HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Referer: http://edtcsun33.ie.oracle.com/test.html
    Accept-Language: en-us
    Content-Type: application/x-www-form-urlencoded
    User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
    Host: edtcsun33.ie.oracle.com
    Content-Length: 102
    name=Alan+Sheppard&addr1=Oracle+Corporation&addr2=Block+2&addr3=Dublin&telep
    
    hone=8033233&color=Red
    
    
  2. Create the template file.

    Using the captured HTTP request, create the template file replacing the name, address, telephone, and other elements with token values. Also, remove the value for Content-Length as this varies depending on the request and therefore is automatically generated by WebHammer. The following is an example of the resulting file template_post:

    POST /cgi-bin/uncgi/myscript HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Referer: http://edtcsun33.ie.oracle.com/test.html
    Accept-Language: en-us
    Content-Type: application/x-www-form-urlencoded
    User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0) 
    Host: edtcsun33.ie.oracle.com
    Content-Length:
    name={1}+{2}&addr1={3}&addr2={4}&addr3={5}&telephone={6}&color={7}
    
    
  3. Create the data file.

    The data file is includes the data which replaces the text indicated with curly brackets {} in the template file to create the scenario file. The following is a sample of the information in the data_post file:

    Alan Sheppard Block+2 Oracle+Corporation Eastpoint 8033233 Blue
    Joe Blogs Block+2 Oracle+Corporation Eastpoint 8033211 Red
    
    
  4. Create the scenario file.

    Using the template file and data file create the scenario file using the mkscenario command.

    iesun8 >   mkscenario   data_post    template_post    scenario_post
    
    

    You can also create a scenario file with randomly ordered output:

    iesun8 >   mkscenario   -r  data_post    template_post    scenario_post
    
    

    The following is a sample of the information created from the file scenario_post:

    POST /cgi-bin/uncgi/myscript HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Referer: http://edtcsun33.ie.oracle.com/test.html
    Accept-Language: en-us
    Content-Type: application/x-www-form-urlencoded
    User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
    Host: edtcsun33.ie.oracle.com
    Content-Length:
    name=Alan+Sheppard&addr1=Block+2&addr2=Oracle+Corporation&addr3=Eastpoint&te
    lephone=8033233&color=Blue
    POST /cgi-bin/uncgi/myscript HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Referer: http://edtcsun33.ie.oracle.com/test.html
    Accept-Language: en-us
    Content-Type: application/x-www-form-urlencoded
    User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
    Host: edtcsun33.ie.oracle.com
    Content-Length:
    name=Joe+Blogs&addr1=Block+2&addr2=Oracle+Corporation&addr3=Eastpoint&teleph
    one=8033211&color=Red
    
    
  5. Run an initial trial test.

    Before running a full test, run a trial test to ensure your setup is correct.

    Run the trial test using verbose level 3. Level 1 shows the actual data sent to the server and level 2 shows the data received from the server. Level 3, which is levels 1 and 2 combined, shows the data sent to and the data received by the server. Inspect the response to ensure that the server has sent back the information expected.

    Use only one URL entry from the scenario file -n 1 .

    Run the test using one user -u 1.

    iesun8 > hammer -v 3 -n 1  -u 1 -p 80 -r edtcsun33 -o log_post scenario_post
    
    

    The following is trace level 3 results:

    Trace level=3
    Parsing scenario file "scenario_post"
    Started 1 users, start staggered by 10 msec, divided workload, each user 
    executes 1 URLs
    Please wait while workload completes...
    Starting user number [0]
    WRITE request data=[POST /cgi-bin/uncgi/myscript HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Referer: http://edtcsun33.ie.oracle.com/test.html^M
    Accept-Language: en-us
    Content-Type: application/x-www-form-urlencoded
    User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
    Host: edtcsun33.ie.oracle.com
    
    Content-Length: 102
    name=Alan+Sheppard&addr1=Block+2&addr2=Oracle+Corporation&addr3=Eastpoint&te
    lephone=8033233&color=Blue]
    READ response data=[HTTP/1.1 200 OK^M
    Date: Tue, 28 Nov 2000 15:36:01 GMT^M
    Server: Apache/1.3.9 (Unix) mod_perl/1.21^M
    Connection: close^M
    Content-Type: text/html^M
    
    ]
    READ response data=[ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
     <HEAD>
      <TITLE>My Script Works!!</TITLE>
     </HEAD>
    <!-- Background white, links blue (unvisited), navy (visited), red (active) 
    -->
     <BODY
      BGCOLOR="#FFFFFF"
      TEXT="#000000"
      LINK="#0000FF"
      VLINK="#000080"
      ALINK="#FF0000"
     >
     Hello I am the result of the script<BR>
     </BODY>
    ]
    READ response data=[name:Alan Sheppard]
    READ response data=[address1: Block 2]
    READ response data=[address2: Oracle Corporation]
    READ response data=[address3: Eastpoint]
    READ response data=[telephone: 8033233]
    READ response data=[color: Blue]
    READ response data=[]
    1 url processed, 0 responses timed out
    Processing results to "log"
    
    
  6. Run the full test.

    The following is a command example that requests information on 10 users -u 10 submitting URL requests at an rate of 1 per second -t 1. The results are displayed without the header information.

    iesun8 >   hammer  -t 1 -u 10 -p 80  -r edtcsun33  -o  log_post  scenario_
    post
    
    
  7. Interpret the result.

    The results are output to a log file -o log_post. The following is a sample of the results. For column information, see Table 3-1, "Default Results" .

    0:329:605:1:0
    1:673:600:1:0
    2:658:600:1:0
    3:654:600:1:0
    4:603:600:1:0
    5:649:600:1:0
    6:648:605:1:0
    7:634:600:1:0
    8:642:600:1:0
    
    

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy