1SIEGE(1) Siege Load Tester SIEGE(1)
2
3
4
6 siege is a HTTP/FTP load tester and benchmarking utility.
7
9 siege [options]
10 siege [options] <URL>
11 siege [options] -g <URL>
12 siege [options] -f urls.txt
13
15 siege is a multi-threaded HTTP/FTP load tester and benchmarking
16 utility. It supports most of the features detailed in RFCs 2616 (HTTP)
17 and 959 (FTP). Properties can be set both from the command line and in
18 a configuration file. When the same property is set in both locations,
19 the command line takes precedence.
20
21 The default configuration file is $HOME/.siege/siege.conf If you don't
22 have a $HOME/.siege directory and a siege.conf and cookies.txt file,
23 siege will generate a new config directory when it runs. You can
24 generate your config directory with the following command: siege.config
25
27 Option Syntax
28 siege supports long and short options. Short options look like this:
29 -c 25
30 -c25
31
32 Long options look like this:
33 --concurrent=25
34
35 Option Values
36 -V, --version
37 Displays the siege release version and copyright information.
38
39 -h, --help
40 Prints a help message describing siege's command-line options.
41
42 -C, --config
43 Prints a detailed summary of all the currently configured options,
44 most of which are sent in $HOME/.siege/siege.conf
45
46 -v, --verbose
47 This directive puts siege into verbose mode which is actually a
48 default setting. This command-line option is useful when the config
49 file is set to 'verbose = false' since it will allow you to
50 override that.
51
52 By default siege's verbose output is displayed in a color-coded
53 style.
54 * HTTP 2xx is coded blue
55 * HTTP 3xx is coded cyan
56 * HTTP 4xx is coded magenta
57 * HTTP 5xx is coded red
58 * HTTP cached is coded black
59
60 NOTE: You can turn off color in siege.conf like this: 'color = off'
61
62 -q, --quiet
63 This directive silences siege. It is mostly used for scripting and
64 is often used in conjunction with -g/--get. You can detect the
65 success or failure of the run with its exit code.
66
67 siege --quiet -g www.joedog.org
68 if [ $? -eq 0 ] ; then
69 echo "Success"
70 else
71 echo "Failure"
72 fi
73
74 -g URL, --get=URL
75 This option allows you to request a URL and watch the header
76 transaction. There is a corresponding config file directive that
77 allows you to set the request method for these requests: gmethod =
78 HEAD|GET
79
80 $ siege -g "https://www.joedog.org/"
81 HEAD / HTTP/1.0
82 Host: www.joedog.org
83 Accept: */*
84 User-Agent: Mozilla/5.0 (unknown-x86_64-linux-gnu) Siege/4.0.0-beta5
85 Connection: close
86
87 HTTP/1.1 200 OK
88 Server: cloudflare-nginx
89 Date: Tue, 09 Feb 2016 18:18:41 GMT
90 Content-Type: text/html; charset=UTF-8
91 Connection: close
92 Last-Modified: Wed, 25 Nov 2015 18:46:08 GMT
93 Cache-Control: max-age=3, must-revalidate
94 Expires: Tue, 09 Feb 2016 18:18:44 GMT
95 Vary: Accept-Encoding,Cookie
96 CF-RAY: 27219407eeff084a-IAD
97
98 NOTE: It's a best practice to quote the URL when it's passed to
99 siege from the the command-line.
100
101 -p URL, --print=URL
102 This option is similar to -g / --get but it PRINTS the page it
103 received from the server.
104
105 $ siege -p http://www.joedog.org/
106 GET / HTTP/1.0
107 Host: www.joedog.org
108 Accept: */*
109 User-Agent: Mozilla/5.0 (unknown-x86_64-linux-gnu) Siege/4.0.3rc1
110 Connection: close
111
112 HTTP/1.1 301 Moved Permanently
113 Date: Wed, 19 Oct 2016 16:58:13 GMT
114 Content-Type: text/html; charset=iso-8859-1
115 Location: https://www.joedog.org/
116 Server: cloudflare-nginx
117 Connection: close
118
119
120 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
121 <html><head>
122 <title>301 Moved Permanently</title>
123 </head><body>
124 <h1>Moved Permanently</h1>
125 <p>The document has moved <a href="https://www.joedog.org/">here</a>.</p>
126 <hr>
127 <address>Apache/2.2.31 (Amazon) Server at www.joedog.org Port 80</address>
128 </body></html>
129
130 -c NUM, --concurrent=NUM
131 This option allows you to set the concurrent number of users. The
132 total number of users is technically limited to your computer's
133 resources.
134
135 You should not configure more users than your web server is
136 configured to handle. For example, the default apache configuration
137 is capped at 255 threads. If you run siege with -c 1024, then 769
138 siege users are left waiting for an apache handler.
139
140 For this reason, the default siege configuration is capped at 255
141 users. You can increase that number inside siege.conf but if you
142 make a mess, then please don't complain to us.
143
144 -r NUM, --reps=NUM|once
145 This option tells each siege user how many times it should run. The
146 value should generally be a number greater than zero but it may be
147 the keyword 'once'.
148
149 If --reps=3 then each siege user will run three times before it
150 exits. However, if --reps=once, then each user will run through
151 the urls.txt file exactly one time.
152
153 For more information about the urls.txt file, see option -f <file>,
154 --file=<file>
155
156 -t NUMm, --time=NUMm
157 This option is similar to --reps but instead of specifying the
158 number of times each user should run, it specifies the amount of
159 time each should run.
160
161 The value format is "NUMm", where "NUM" is an amount of time and
162 the "m" modifier is either S, M, or H for seconds, minutes and
163 hours. To run siege for an hour, you could select any one of the
164 following combinations: -t3600S, -t60M, -t1H. The modifier is not
165 case sensitive, but it does require no space between the number and
166 itself.
167
168 -d NUM, --delay=NUM
169 This option instructs siege how long to delay between each page
170 request. The value NUM represents the number of seconds between
171 each one. This number can be a decimal value. In fact the default
172 is half a second (--delay=0.5).
173
174 The time between delay requests is NOT applied toward the
175 transaction time. If two 0.1 second transactions have a 2 second
176 delay between them, their average transaction time is 0.1 seconds.
177 It is applied toward the total elapsed time. In this scenario, the
178 elapsed time would be 2.2 seconds.
179
180 NOTE: when the parser is enabled (see: -p/--parser), there is no
181 delay between the page and its elements, i.e., style sheets,
182 javascripts, etc. The delay is only between page requests.
183
184 -b, --benchmark
185 This directive tells siege to go into benchmark mode. This means
186 there is no delay between iterations.
187
188 -i, --internet
189 This option sets siege into what we call internet mode. It makes
190 requests from the urls.txt file (see: -f <file> / --file=<file>) in
191 random order.
192
193 -f FILE, --file=FILE
194 This option tells siege to work with a list of urls inside a text
195 file. The URLs are listed one per line. Unlike URLs that are passed
196 as a command-line argument, the URLs in this file should not be
197 quoted.
198
199 siege's urls.txt parser supports comments and variables.
200
201 -R FILE, --rc=FILE
202 This directive allows you to set an alternative resource file. By
203 default, the siegerc file is $HOME/.siege/siege.conf With this
204 directive, you can override the default and use an alternative
205 file.
206
207 -L FILE, --log=FILE
208 The default log file is $prefix/var/log/siege.log. This directive
209 allows you to specify an alternative file for logging.
210
211 -m "string", --mark="string"
212 This option allows you to log a message to the log file before your
213 stats are written there. It is generally used to identify the
214 proceding run. You could, for example, mark the file with your
215 command-line parameters so it's understood what configuration
216 generated the following data.
217
218 -H "header: value", --header="Header: value"
219 This options allows you to set a custom header in the request.
220 Generally speaking, this header will override an existing header.
221 The Cookie header is a special case. If you set -H "Cookie: value"
222 then siege will send that cookie in addition to the other ones.
223
224 -A "string", --agent="string"
225 This option allows you to override the default user-agent with a
226 custom one.
227
228 siege --agent="JoeDog Jr. in da hizzle"
229
230 Will set this header:
231
232 User-agent: JoeDog Jr. in da hizzle
233
234 Alternatively, you could set the User-agent with the -H/--header
235 option above.
236
237 -T "text", --content-type="text"
238 This is another set header shortcut. You use this option to
239 override the default Content-type request header.
240
241 --no-parser
242 Turn off the HTML parser. When siege downloads a page, it parses it
243 for additional page elements such as style-sheets, javascript and
244 images. It will make additional requests for any elements it finds.
245 With this option enabled, siege will stop after it pulls down the
246 main page.
247
248 --no-follow
249 This directive instructs siege not to follow 3xx redirects.
250
252 siege supports RFC 1738 URL formats but it takes pains to implement
253 commonly used shortcuts for your convenience. In addition to RFC 1738
254 formats, siege introduces its own URL format to indicate protocol
255 method.
256
257 An RFC 1738 URL looks like this:
258 <scheme>://<username>:<password>@<hostname>:<port>/<path>;<params>?<query>#<frag>
259
260 A siege URL with a method indicator looks like this:
261 <scheme>://<username>:<password>@<hostname>:<port>/<path> POST
262 <query>
263
264 You can also post the contents of a file using the redirect character
265 like this:
266 <scheme>://<username>:<password>@<hostname>:<port>/<path> POST
267 </home/jeff/haha.txt
268
269 Here are two examples with the siege method indicator:
270 http://www.joedog.org/ POST haha=papa&dada=mama
271 ftp://ftp.armstrong.com/ PUT </home/jdfulmer/etc/tests/bbc.jpg
272
273 NOTE: If you set URLs with method indicators at the command-line, then
274 you MUST quote the thing or your shell will treat it like three
275 separate arguments. If the URL is in a urls.txt file, then you
276 shouldn't quote it.
277
278 As mentioned above, siege goes to great lengths to allow commonly used
279 shortcuts that you're used to from most browser implementations. It
280 treats many parts of the 1738 URL as optional. In this example, the
281 parts in brackets are optional:
282 [scheme://] host.domain.xxx [:port] [/path/file]
283
284 When siege receives a host name it builds the URL with default
285 assumptions. www.joedog.org becomes http://www.joedog.org:80/
286
288 From the section called Option Syntax above we learn that siege can
289 take a URL as an argument. siege -c -r2 www.joedog.org will request the
290 JoeDog index page twice. But what if you want to hit large portions of
291 the site? siege will allow you to fill a file with URLs so that it can
292 run through list.
293
294 The format for the file is one URL per line:
295 https://www.joedog.org/
296 https://www.joedog.org/haha/
297 https://www.joedog.org/haha/ POST homer=simpson&marge=doestoo
298
299 The file also supports UNIX-style commenting:
300 # Comment looks like this
301 https://www.joedog.org/
302 https://www.joedog.org/haha/
303 https://www.joedog.org/haha/ POST homer=simpson&marge=doestoo
304
305 It supports shell-style variable declaration and references. This is
306 convenient if you want to run the same test on two different tiers or
307 two different schemes:
308
309 SCHEME=https
310 HOST=bart.joedog.org
311 $(SCHEME)://$(HOST)/
312 $(SCHEME)://$(HOST)/haha/
313 $(SCHEME)://$(HOST)/haha/ POST homer=simpson&marge=doestoo
314
315 You can tell siege about this file with the -f/--file option:
316 siege -c1 -r50 -f /home/jeff/urls.txt
317
319 When its run is complete, siege will gather performance data from all
320 its clients and summarize them after the run. (You can also choose to
321 log these numbers). The command-line output is modeled after Lincoln
322 Stein's torture.pl script:
323
324 Transactions: 2000 hits
325 Availability: 100.00 %
326 Elapsed time: 58.57 secs
327 Data transferred: 5.75 MB
328 Response time: 0.25 secs
329 Transaction rate: 34.15 trans/sec
330 Throughput: 0.10 MB/sec
331 Concurrency: 8.45
332 Successful transactions: 2000
333 Failed transactions: 0
334 Longest transaction: 4.62
335 Shortest transaction: 0.00
336
337 Transactions
338 This number represents the total number of HTTP requests. In this
339 example, we ran 25 simulated users [-c25] and each ran ten times
340 [-r10]. Twenty-five times ten equals 250 so why is the transaction
341 total 2000? That's because siege counts every request. This run
342 included a META redirect, a 301 redirect and the page it requested
343 contained several elements that were also downloaded.
344
345 Availability
346 This is the percentage of socket connections successfully handled
347 by the server. It is the result of socket failures (including
348 timeouts) divided by the sum of all connection attempts. This
349 number does not include 400 and 500 level server errors which are
350 recorded in "Failed transactions" described below.
351
352 Elapsed time
353 The duration of the entire siege test. This is measured from the
354 time the user invokes siege until the last simulated user
355 completes its transactions. Shown above, the test took 14.67
356 seconds to complete.
357
358 Data transferred
359 The sum of data transferred to every siege simulated user. It
360 includes the header information as well as content. Because it
361 includes header information, the number reported by siege will
362 be larger then the number reported by the server. In internet
363 mode, which hits random URLs in a configuration file, this
364 number is expected to vary from run to run.
365
366 Response time
367 The average time it took to respond to each simulated user's requests.
368
369 Transaction rate
370 The average number of transactions the server was able to handle
371 per second, in a nutshell: it is the count of all transactions
372 divided by elapsed time.
373
374 Throughput
375 The average number of bytes transferred every second from the
376 server to all the simulated users.
377
378 Concurrency
379 This is the average number of simultaneous connections. The metric
380 is calculated like this: the sum of all transaction times divided
381 by elapsed time (how long siege ran)
382
383 Successful transactions
384 The number of times the server responded with a return code < 400.
385
386 Failed transactions
387 The number of times the socket transactions failed which includes
388 socket timeouts.
389
390 Longest transaction
391 The greatest amount of time that any single transaction took, out
392 of all transactions.
393
394 Shortest transaction
395 The smallest amount of time that any single transaction took, out
396 of all transactions.
397
399 Jeffrey Fulmer, et al. <jeff@joedog.org> is the primary author of
400 siege. Numerous people throughout the globe also contributed to this
401 program. Their contributions are noted in the source code ChangeLog
402
404 Copyright by Jeffrey Fulmer, et al. <jeff@joedog.org>
405
406 This program is free software; you can redistribute it and/or modify it
407 under the terms of the GNU General Public License as published by the
408 Free Software Foundation; either version 2 of the License, or (at your
409 option) any later version.
410
411 This program is distributed in the hope that it will be useful, but
412 WITHOUT ANY WARRANTY; without even the implied warranty of
413 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
414 General Public License for more details.
415
416 You should have received a copy of the GNU General Public License along
417 with this program; if not, write to the Free Software Foundation, Inc.,
418 675 Mass Ave, Cambridge, MA 02139, USA.
419
421 The most recent released version of siege is available by HTTP
422 download:
423 http://download.joedog.org/pub/siege
424
426 siege.config(1) bombardment(1) siege2csv(1)
427
428
429
430JoeDog 2021-03-17 SIEGE(1)