Oracle WebHammer User's Guide
Release 1.0.0.0.0

Part Number Z27029-01

Index

Go to previous page Go to next page

3
Using WebHammer

This chapter provides an overview of how to use the WebHammer utility. It includes the following sections:

WebHammer Syntax

WebHammer includes the hammer command.

The hammer command runs a workload on a Web server. It simulates multiple users carrying out different operations on a Web site.

The scenario file contains a list of URL operations that are performed on the Web site. In order to use the hammer command, you must have a scenario file that specifies the workload run on the Web site using the hammer command. Comments are not allowed in a scenario file. Each operation in a scenario file must start in column one.

Multi-level trace is supported and is useful when establishing a workload or when troubleshooting is required.

For more information on multi-level trace, see Using Trace.

Synopsis

The following is the hammer command syntax:

hammer [-f] [-R] [-h] [-V] [-c] [-t throughput] [-n urls] [-u users] [-l 
localhost]  [-r remote]  [-p  port] [-v level] [-o log_file]  [scenario_file] 


Options

WebHammer supports the options listed in the following table:

-f 

Run workload repeatedly forever, or until you stop the test. You can stop the test in two ways:

  • Press CTRL-C.

  • Enter the interrupt character.

 

-R 

Randomize the user start times. The default for this option starts users sequentially, staggering their start times by 10 milliseconds. 

-h 

Print header information when displaying results. 

-c 

Each user performs the full workload specified in the scenario file.

If this option is not specified the workload, as specified in the scenario file, is equally divided between the users -- each user executes a portion of the workload.

The default setting divides the workload among the users. 

-V 

Version information. 

-t throughput 

Specify the throughput at which URLs should be submitted, where throughput is the desired number of URLs per second submitted.

-t 200 means that that a maximum of 200 URLs per second is submitted to the Web site.

-t.5 means that one URL every two seconds is submitted to the Web site.

-t .1 means that one URL every ten seconds is submitted to the Web site. 

-l localhost 

The host name or IP address of the local machine. This is normally not required as the local machine name and IP address is picked up by default. This is useful when the local machine has more than one IP address and you wish to specify a particular IP address. This allows the support of multiple IP addresses with or without aliases. 

-r remote 

The remote hostname of the Web server on which the workload runs.

The default hostname is webserver

-p port 

The port number of the server which the Web server listens on.

The default port number is 80. 

-u users 

The number of simultaneous users to simulate.

The default number of users is 1 (one). 

-n number 

The number of URLs to use from the scenario file.

The default is the number of URLs specified in the scenario file. 

-v level 

Specify the verbose trace level where level is a number between 1 and 31.

  • Level 1 - print URL data received from Web server in response to a URL operation

  • Level 2 - print URL text that is sent to the Web server

  • Level 4 - display the number of bytes that are read from the Web server in response to a URL request

  • Level 8 - URL transmission rate information

  • Level 16 - general trace

Trace levels can be combined, for example 1+2+4+8+16= 31 includes all debug information.

Trace information is useful when you are setting up your workload initially or if you are experiencing problems and need extra information in order to troubleshoot.

Level 1 displays the actual response that is read from the Web server after the URL request is sent to the Web server. This is useful when validating a response from the Web server to a URL operation.

Level 2 displays the actual URL string sent to the Web server and the type of operation GET, SEND, POST.

Level 4 displays the number of bytes read from the Web server in response to a URL request being sent to the Web server.

Level 8 displays information on whether URLs are being submitted too fast or too slow for the required throughput.

Level 16 displays general trace information such as:

  • the number of URLs to be processed

  • information on the threads spawned

  • when a new TCP/IP connection is established

For more information and examples of trace, see Using Trace

-o log_file 

Log results to the file specified by log_file.

If this option is not specified then the results are output to the standard output. Note that outputting results to a log file or the standard output has no impact on the performance of the workload as this task is performed when the workload is finished. 

Operands

There is one operand supported by the hammer command.

A scenario_file is the path name of a file containing the workload. If the file specified is not found, a diagnostic message is output on standard error.

The default name for the scenario file is scenario. It is located in the current working directory.

Hammer Command Examples

The following are examples of the hammer command:

example%  hammer  -u 5  -p 8080  -r 196.168.1.105 -o log scenario1

This shows a workload with 5 users (-u 5) run on a Web server listening on port 8080 on a system with the IP address 196.168.1.105. The results are output to log and the workload is read from scenario1

example%  hammer  -u 10  -p 8080  -r asc6  -o log  scenario1

This shows a workload with 10 users (-u 10) run on a Web server listening on port 8080 on a system called asc6. The results are output to log and the workload is read from scenario1


example%  hammer  -u 1  -v 1  -p 8080   -r asc6 scenario1

This shows a workload with 1 user (-u 1) run on a Web server listening on port 8080 on a system called asc6. The workload is read from scenario1. Level 1 trace (-v 1) is used in order to validate the response from the Web server.

example% hammer -u 10 -t 200 -p 8080 -r asc6 scenario1

This show a workload with 10 users (-u 10) run on a Web server listening on port 8080 on a system called asc6. The workload is read from scenario1. A desired throughput of 200 URLs/sec (-t 200) for each user has been specified.

example% hammer  -u 10  -n 1000 -p 8080   -r asc6  scenario1

This shows a workload with 10 users (-u 10) run on a Web server listening on port 8080 on a system called asc6. The workload is read from scenario1. 1000 URL operations (-n 1000) will be perform from the scenario file.

example% hammer -u 10 -c -p 8080  -r asc6 scenario1

This shows a workload with 10 users (-u 10) run on a Web server listening on port 8080 on a system called asc6. The workload is read from scenario1. Each user performs the entire workload as specified (-c) in the scenario file.

Exit Status

The following are possible exit status results of the hammer command on UNIX:

0   All information was written successfully.
>0  An error occurred.

Files

The scenario file is specified as a command line option to the hammer command. The scenario file contains a list of URL operations. In order to use the hammer command, you must have a scenario file to specify the workload that is run on the Web site using the hammer command.

Example GET Operation

The following is an example of one type of URL operation that is submitted via WebHammer to the Web site. It is a list of GET commands plus URLs.

GET /test/00/00/16/11/home.html
GET /test/00/00/16/12/home.html
GET /test/00/00/16/13/home.html
GET /test/00/00/16/14/home.html
GET /test/00/00/16/15/home.html
GET /test/00/00/16/16/home.html
GET /test/00/00/16/17/home.html
GET /test/00/00/16/18/home.html

GET /test/00/00/16/19/home.html
GET /test/00/00/16/20/home.html
GET /test/00/00/16/21/home.html
GET /test/00/00/16/22/home.html
GET /test/00/00/16/23/home.html
GET /test/00/00/16/24/home.html
GET /test/00/00/16/25/home.html

Example POST Operation

The following is an example of a POST operation. A POST operation is a URL operation that is sent to the Web server after you fill in a web form and click Submit or Send.

POST /AeosDemo/UserInput/portal_i_profile_username HTTP/1.0.Referer: 
http://ias2:8080/AeosDemo/UserGet/profile/portal_i_profile_
username.htm?refnumber=1001235.Connection: Keep-Alive.User-Agent: Mozilla/4.72 
[en] (X11; U; Linux 2.2.14-11.lfssmp i686).Host: ias2:8080.Accept: image/gif, 
image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*.Accept-Encoding: 
gzip.Accept-Language: en.Accept-Charset:iso-8859-1,*,utf-8.Authorization: Basic 
UFUwMDAwMDAwNTpQVTAwMDAwMDA1.Content-type: 
application/x-www-form-urlencoded.Content-length: 721.Content-type: 
application/x-www-form-urlencoded.Content-length: 721.._
DESCRIBE=profile%2Fportal_i_profile_entry_Describe.dsc&_FORM_ACTION=portal_i_
profile_Submit&_PASS_URL=Standard_Pass.html&_FAIL_URL=Standard_Fail.html&_FAIL_
URL100=profile%2Fportal_errors_frameSet.htm&piprofid_ref=1001235&task_
ref=&pPostStr=%230%23&piprofid_ref=1001235&ppname_fname=joe15&ppname_

mname=j&ppname_
sname=bloggs15&pemail=jbloggs15%40oracle.com&pUserName=jbloggs15&paddress_
add1=&paddress_add2=&paddress_add3=&paddress_citytown=&paddress_
county=&paddress_cntry=country&ppname_fsalut=&paddress_postcode=d+5&pphonework_
std=&pphonework_number=&pphonehome_std=&pphonehome_number=&pphonemobile_
std=&pphonemobile_number=&pfaxhome_std=&pfaxhome_number=&pfaxwork_std=&pfaxwork_
number=&_submitForm.x=34&_submitForm.y=5

Log File

The overall duration for the workload is timed and the duration for each individual URL operation and corresponding number of bytes received for each URL operation is recorded. This information can be output to a log file (by specifying the option -o log_file) and placed in an exportable format.

The following table contains information about the output of the log file:

Table 3-1 Default Results
Column Position  Description 

Displays a unique number that identifies the URL for this user. 

Displays the time, in milliseconds, for this URL operation to complete. 

Displays the number of bytes received for this URL operation. 

Displays the number of times a response was received from the Web server for this URL operation.

This should be no greater than 1 unless the -f option has been specified. 

Displays the number of times the Web server failed to respond to the request during the timeout period. 

The following is an example of a log file, showing URL operations without displaying user information and header information:

0:2:300:1:0
1:1:300:1:0
2:1:300:1:0
3:1:300:1:0
4:1:300:1:0
5:1:300:1:0
6:1:300:1:0
7:1:300:1:0
8:1:300:1:0
9:1:300:1:0
10:1:300:1:0
11:1:300:1:0
12:1:300:1:0
13:1:300:1:0
14:1:300:1:0
15:1:300:1:0
16:1:300:1:0
17:1:300:1:0
18:1:300:1:0
19:1:300:1:0
20:1:300:1:0
21:1:300:1:0
22:1:300:1:0

The following table contains information about the output of the log file with heading summary information:

Table 3-2 Heading Summary Result
Column Position  Description 

Displays the user number. 

Displays the total time in milliseconds for all URL operations performed by this user. 

Displays the total number of bytes received for all URL operations performed by the user. 

The following example displays log output for users and URLs with header 
information for two virtual users:

[Transaction no] Transaction Time (msec): Bytes Rx
0:4:3000
[URL no] URL Time (msec): Bytes Rx: [URL]
0:2:300:1:0: GET /test/00/00/16/11/home.html
1:1:300:1:0: GET /test/00/00/16/12/home.html
2:1:300:1:0: GET /test/00/00/16/13/home.html
3:1:300:1:0: GET /test/00/00/16/14/home.html
4:1:300:1:0: GET /test/00/00/16/15/home.html
5:1:300:1:0: GET /test/00/00/16/16/home.html
6:1:300:1:0: GET /test/00/00/16/17/home.html
7:1:300:1:0: GET /test/00/00/16/18/home.html
8:1:300:1:0: GET /test/00/00/16/19/home.html
9:1:300:1:0: GET /test/00/00/16/21/home.html

[Transaction no] Transaction Time (msec): Bytes Rx
1:4:3000
[URL no] URL Time (msec): Bytes Rx: [URL]
0:2:300:1:0: GET /test/00/00/16/11/home.html
1:1:300:1:0: GET /test/00/00/16/12/home.html
2:1:300:1:0: GET /test/00/00/16/13/home.html

3:1:300:1:0: GET /test/00/00/16/14/home.html
4:1:300:1:0: GET /test/00/00/16/15/home.html
5:1:300:1:0: GET /test/00/00/16/16/home.html
6:1:300:1:0: GET /test/00/00/16/17/home.html
7:1:300:1:0: GET /test/00/00/16/18/home.html
8:1:300:1:0: GET /test/00/00/16/19/home.html
9:1:300:1:0: GET /test/00/00/16/21/home.html


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