1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
|
hammerhead(1) hammerhead(1)
NNAAMMEE
hammerhead - perform load testing on a given machine/port
with a set of http requests
SSYYNNOOPPSSIISS
hhaammmmeerrhheeaadd [ _o_p_t_i_o_n_s ] [ _r_e_s_u_l_t_s_F_i_l_e ]
DDEESSCCRRIIPPTTIIOONN
HHaammmmeerrhheeaadd is a web site coverage and stress testing tool.
It's also useful for benchmarking your web servers. It's
been designed to emulate multiple users from multiple IP
addresses and designed for maximum speed unlike it's
interpreted counterparts. It's highly configurable and
supports scenario based requests. The hhaammmmeerrhheeaadd command
is sends HTTP requests to a nominated machine/port (as
specified in the ccoonnffiiggFFiillee)) to simulate load on that
port. It can be used to test the behaviour of the port
under load, or the ability of the port to service a set of
requests.
The behaviour of hhaammmmeerrhheeaadd is defined (almost) entirely
by the ccoonnffiiggffiillee.. See the description of this file below
for an explanation of all of the configuration options.
hhaammmmeerrhheeaadd loads a set of requests from a number of files,
each of which may contain a number of scenarios (one
request per scenario). Scenarios may be linked into
sequences, in order to simulate real users actions.
Once the scenarios are loaded, hhaammmmeerrhheeaadd starts up a num-
ber of threads and sends requests to the port. The
expected result of a request may be specified in a sce-
nario, and any result from the port which does not match
with the expected result will be reported as an error. If
no expected results are specified, then any result from
the port will be accepted as valid. Specifying an expected
result for any scenario has the effect of specifying the
same result for aallll scenarios which have the same request.
Any failure to get a connection to the port, or any fail-
ure to receive a reply to a request will also be reported.
OOPPTTIIOONNSS
The following options are supported:
--ss oorr ----sseeccoonnddss
Seconds to run tests for
--oo oorr ----oouuttffiillee
Output result file
--tt oorr ----tteesstt
Test the scenarios in the conf file.
--CC oorr ----cchheecckkccoonnff
Check config file
--cc oorr ----ccoonnffffiillee
Config file path
--hh oorr ----hheellpp
Display help information
--vv oorr ----vveerrssiioonn
Output version
OOPPEERRAANNDDSS
The following operand is supported:
_r_e_s_u_l_t_s_F_i_l_e_:
Create an optimized scenario file to make hhaammmmeerrhheeaadd load
faster.
CCOONNFFIIGGUURRAATTIIOONN FFIILLEE
The configuration file is a plain text file, containing a
set of attribute/value pairs. Attribute names are matched
without regard to case.
Any line in the file beginning with a hash (#) is treated
as a comment, and ignored.
The attributes which may be defined in this file are:
SScceennaarriioo__ddiirreeccttoorryy
The directory in which to find the Scenario file(s). All
scenario files in this directory will be loaded. A sce-
nario file is any file with the extension ..ssccnn (case sen-
sitive). There may be more than one directive on a config-
uration file. Each directory shall be examined for sce-
nario files.
default value: /var/tmp/scenarios/
SScceennaarriioo__ffiillee
A specific file from which to read scenarios. There may be
more than one directive on a configuration file.
LLoogg__ffiilleennaammee
The file in which all log messages will be written. If
this file cannot be created, hhaammmmeerrhheeaadd will default to
using standard error.
default value: /var/tmp/hammerhead/hh.log
LLooaadd__iimmaaggeess
A flag indicating whether to automatically load images
which are referenced in the result of a request.
posible values: on, off
default value: off
SSeessssiioonnss
The number of threads to start up.
default value: 1000
SSeeeedd
The random number seed used for the random selection of
requests. Setting this number to any non-zero value will
give deterministic behaviour (i.e. the same sequence of
requests will be selected)
default value: 0
SSeeqquueennccee__pprroobbaabbiilliittyy
The percentage of the time that hhaammmmeerrhheeaadd will follow the
sequence that the current request is in. Setting this to
100 will force hammerhead to follow any sequence it
encounters to its completion.
default value: 75
SSlleeeepp__ttiimmee
The amount of time (in milliseconds) to sleep between
requests. In fact, this is the average sleep time, and
hhaammmmeerrhheeaadd will sleep for a randomly selected period,
between 0 milliseconds, and twice this value.
default value: 0
RRuunn__ttiimmee
The number of seconds to run each thread. If this value is
0, the threads run for-ever. This can be used to set up
tests which run for a particular length of time.
default value: 0
MMaacchhiinnee__IIPP
The IP number (and possibly port) of the machine/port to
hammer. The format is <machine_number>[:<port_number>],
where <machine_number> is as described in mmaann iinneett__aaddddrr
and <port_number> is optional.
This is the oonnllyy attribute that must be defined in a con-
figuration file
default value: no default for <machine_number>, 8080 for
<port_number>
IIpp__AAlliiaass
The outgoing IP numbers; allows Hammerhead to simulate
multiple machines (upto 1 machine / session). May be any
of the following forms: 10.0.0.1, 10.0.0.*, 10.0.*.*,
10.0.1-5.*, 10.0.0.1-5.
default value: the hammering machines normal IP address
PPrreemmaattuurree__CClloossee
The percentage of requests that will be improperly termi-
nated before sending/receiving is completed properly (to
test problems such as FIN_WAIT1).
default value: 0
BBaadd__RReeqquueesstt
The percentage of requests the will be scrambled requests
(outside the properly defined scenarios).
default value: 0
RReeppoorrtt__TTiimmee
The time interval upon which to written report summaries
to the report log.
default value: 0 (report only once at test end.)
RReeppoorrtt__LLoogg
The log file which is to contain the report summaries.
default value: /var/tmp/report.log
RRoobboott__IIDD
The robot id to be passed to the servers being hammered.
Currently not implemented.
SSeenndd__CCooookkiiee
Turn on to allow the sending of cookies with requests.
Incoming cookies are buffered with each session when a
Set-Cookie header is found. They're sent back with further
requests to that session. Cookies are capped at 4K.
default value: off
PPrreemmaattuurree__CClloossee
The percentage of connections which will close permaturely
before the request reply has been fully read back from the
server.
default value: 0
LLoogg__LLeevveell
Log levels defined to work with the crawl functionality -
somewhat mystical and not confirmed to be working.
default value: 0
BBaannddwwiiddtthh__LLiimmiitt
Turn on bandwidth limiting.
Not implemented yet.
CCrraawwll
Crawl though the URLs contained in the reply to a request.
Scope is somewhat unclear. Use with caution.
default value: off
SSeelleeccttOOnn
When choosing a new sequence to commence, select from all
the scenarios [ _s_c_e_n_a_r_i_o ] or select from those scenarios
which are at the beginning of a sequence of scenarios [
_s_e_q_u_e_n_c_e ].
default value: scenario
SSttaarrtt__LLaagg
Start lag is a delay at thread startup before the first
request is issued. The delay can be used to control the
size of any startup spikes during the commencement of the
test. The threads (processes) pause for a time between 0
and (Start_Lag * Sessions) milliseconds before issuing
their first request.
default value: 1 millisecond
DDNNSS__SSeerrvveerr
Allow the specification of an alternate DNS server to use
to resolve the machinenames. This resolution is completed
once server DNS_TTL seconds.
default value: use the server nominated in
_/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f
DDNNSS__TTTTLL
The Time To Live for the self cached DNS queries.
default value: 120 seconds
MMaacchhiinnee__NNaammee
The name of the machine/s to hammer. Names are resolved to
addresses using the DNS resolver.
UUssee__SSSSLL
Should SSL be used during each request?
default value: no
HHTTTTPP__RReeqquueesstt__TTyyppee
Specify the HTTP request version, the default value is
recommended as Hammerhead maybe not handle all 1.1 return
packets correctly.
default value: HTTP/1.0
BBoottttlleeNNeecckk
Use connection bottlenecking to extend connecton holding
time
Not implemented yet.
MMaaxx__FFaaiilluurreess
The maximum number of request failures to be tolerated
before we abandon the test. The value 0 means that hammer-
head will never stop because of an excessive number of
request failures.
default value: 0
SSCCEENNAARRIIOO FFIILLEE
A scenario file is a plain text file, containing a set of
tagged value lines. The first character of each line is
the tag, and the rest of the line is the value. Tags are
matched case-sensitively.
Any line in the file beginning with a hash (#) is treated
as a comment, and ignored.
The tag types which are legal in this file are:
NN
The name of the scenario. A free-format string
default value: the name of the scenario file
DD
Any dependencies to be met.
Unused at present.
RR
The request to make. A valid HTTP request.
No default value. Scenarios without a Request are dis-
carded.
HH
A header (beyond the basic GET request).
No default value.
BB
The body of a POST request
No default value.
EE
Expected results. Note that hhaammmmeerrhheeaadd will strip off all
HTTP header lines from the response (i.e. all lines up to
the first blank line in the response).
No default value.
LL
Expected Log result.
Not implemented yet.
SS
Name of the next scenario in a sequence
No default value. A scenario without a SS scenario speci-
fied is assumed to be the last in a sequence.
TT
This option has 3 possible types of value: A number is the
"think" (or wait) time in milliseconds. If a '+' proceeds
the number then this specifies a fixed time from when Ham-
merhead begin to wait until (in milliseconds). If the 3rd
special value '_exit' is given, then the thread running
this scenario witll terminate after completing it.
default value: 0
XX
The number of times this scenario may be cross-referenced
by other scenarios (i.e. may be used in a sequence). A
value of -1 is used to represent unlimited use, while 0
and positive numbers have the obvious meaning.
default value: -1
OO
A number of options relating to a scenario are available.
For example,
SSSSLL = [ _o_n|_o_f_f ]
This option turns SSL on or off for this request,
overriding the use of SSL in the configuration
file.
PPOORRTT = [ _p_o_r_t ]
This option allows for an alternative port number
to be specificed for this scenario, overriding the
port specified in the configuration file.
..
End of scenario definition.
RREESSUULLTTSS FFIILLEE
The results file contains a log of all requests. Each log
line contains a time stamp, the process id of the session,
the name of the scenario used, three times, the size of
the response, the return code from the server and the
server description.
The three recorded times are an offset from the initial
start time, the time it took to get the first response
from the server and the total time it took to get the com-
plete response and process it. Typically these two times
are similar, although network issues can cause the total
time to be somewhat greater than the response time. Each
time value is recorded in milliseconds.
EEXXAAMMPPLLEESS
CCoonnffiigguurraattiioonn FFiillee
# example configuration file - test.conf
# find all scenarios in this directory
Scenario_directory /u01/hammerhead/test1
# put all log messages in this file
Log_filename /u01/hammerhead/test1/test1.log
# Load all embedded images in each page returned by the
port
Load_images on
# Simulate 50 users
Sessions 50
# Force all sequences to be completed
Sequence_probability 100
# Sleep 100ms between each request
Sleep_time 100
# Run the test for 10 minutes
Run_time 600
# Hammer goanna, on port 8080
10.456.789.012:8080
SScceennaarriioo FFiillee
# Example Scenario file - test.scn
# Get the main page, then think for one second, then go
to
# the next scenario
NTest Scenario 1
RGET / HTTP/1.0
STest Scenario 2
T1000000
E<html>
E<head>
E<title>Hammerhead - exploring Hammerland</title>
E<link rev=made href="mailto:feedback@hammerhead.source-
forge.net">
E</head>
.
# Get some random page, don't think, and go nowhere else
# NOTE: . at end of scenario not required at end of file
NTest Scenario 2
RGET /coma HTTP/1.0
UUssaaggee
The following example:
eexxaammppllee%% hhaammmmeerrhheeaadd --cc tteesstt..ccoonnff rreessuullttss..lloogg
hammers the machine/port specified in the tteesstt..ccoonnff con-
figuration file.
EEXXIITT SSTTAATTUUSS
The following exit values are returned:
00 hhaammmmeerrhheeaadd ran successfully to completion.
>>00 An error occurred.
SSEEEE AALLSSOO
iinneett__aaddddrr(3N)
NNOOTTEESS
The scenario file created by hhaammmmeerrhheeaadd when using the
rreessuullttssFFiillee operand is optimised to make it quicker for to
load. All scenario names will be lost. Since hhaammmmeerrhheeaadd
only ever reports errors in terms of the request being
made, this is no great loss.
The results generated when using the rreessuullttssFFiillee operand
may contain non-printing characters which may corrupt ter-
minal settings.
03 Jul 2002 hammerhead(1)
|