Man page for apt-get siege Command
This tutorial shows the man page for man siege in linux.
Open terminal with 'su' access and type the command as shown below:
Result of the Command Execution shown below:
siege An HTTP/HTTPS stress tester
Siege is a multi threaded http load testing and benchmarking utility.
It was designed to let web developers measure the performance of their
code under duress. It allows one to hit a web server with a config
urable number of concurrent simulated users. Those users place the
webserver "under siege." Performance measures include elapsed time,
total data transferred, server response time, its transaction rate, its
throughput, its concurrency and the number of times it returned OK.
These measures are quantified and reported at the end of each run.
Their meaning and significance is discussed below. Siege has essen
tially three modes of operation: regression (when invoked by bombard
ment), internet simulation and brute force.
The format for invoking siege is: siege [options]
siege [options] [url]
siege g [url]
Siege supports the following command line options:
VERSION, prints the version number
HELP, prints the help section which includes a summary of all
the command line options.
CONFIGURATION, prints the current configuration in the
$HOME/.siegerc file. Edit that file to set flag values for
EVERY siege run, a feature which eases runtime invocation. You
set an alternative resource file with the SIEGERC environment
variable: export SIEGERC=/home/jeff/haha
VERBOSE, prints the HTTP return status and the GET request to
the screen. Useful when reading a series of URLs from a
configuration file. This flag allows you to witness the
progress of the test.
GET, pull down headers from the server and display HTTP transac
tion. Great for web application debugging. Requires a URL be
passed to siege on the command line.
c NUM, concurrent=NUM
CONCURRENT, allows you to set the concurrent number of simulated
users to num. The number of simulated users is limited to the
resources on the computer running siege.
INTERNET, generates user simulation by randomly hitting the URLs
read from the urls.txt file. This option is viable only with
the urls.txt file.
d NUM, delay=NUM
DELAY, each siege simulated users sleeps for a random interval
in seconds between 0 and NUM.
BENCHMARK, runs the test with NO DELAY for throughput benchmark
ing. By default each simulated user is invoked with at least a
one second delay. This option removes that delay. It is not
recommended that you use this option while load testing.
r NUM, reps=NUM, reps=once
REPS, allows you to run the siege for NUM repetitions. If
reps=once, then siege will run through the urls.txt file one
time and stop when it reaches the end. NOTE: t/ time takes
precedent over r/ reps. If you want to use this option, make
sure time = x is commented out in your $HOME/.siegerc file.
t NUMm, time=NUMm
TIME, allows you to run the test for a selected period of time.
The format is "NUMm", where NUM is a time unit and the "m" modi
fier is either S, M, or H for seconds, minutes and hours. To
run siege for an hour, you could select any one of the following
combinations: t3600S, t60M, t1H. The modifier is not case
sensitive, but it does require no space between the number and
LOG, log stats to SIEGE_HOME/var/siege.log. If you've installed
siege in /usr/local, then the siege.log is
/usr/local/var/siege.log. This option logs the final statistics
reported when siege successfully completes its test. You can
edit $HOME/.siegerc to change the location of the siege.log
m MESSAGE, mark=MESSAGE
MARK, mark the log file with a separator. This option will
allow you to separate your log file entries with header informa
tion. This is especially useful when testing two different
servers. It is not necessary to use both the m option and the
l option. m assumes l so it marks and logs the transaction.
If the MESSAGE has spaces in it, make sure that you put it in
H HEADER, header=HEADER
HEADER, this option allows you to add additional header informa
R SIEGERC, rc=SIEGERC
RC, sets the siegerc file for the run. This option overrides the
environment variable SIEGERC and the default resource file,
f FILE, file=FILE
FILE, the default URL file is SIEGE_HOME/etc/urls.txt. To
select a different URL file, use this option, i.e., siege f
A "User Agent", user agent="User Agent"
AGENT, use this option to set the User Agent in the request.
Siege understands the following URL formats:
(brackets indicate the directive is optional)
[protocol://] host.domain.xxx [:port] [/path/file]
host.domain.xxx/file POST field=value&field2=value2
Or you can POST the contents of a file using the line input operator,
the "<" character:
The first example above is an implicit GET, the next two are obviously
POSTs. You can pass parameters using GET much like you would in a web
If you invoke the URL as a command line argument, you should probably
place it in quotes. Currently, it supports two protocols, http and
https. If a protocol is not specified, then siege assumes http. The
minimum URL requirement is this: servername. That's it. So if you're
in the same domain as a server named shemp and shemp is in your host
file or it is in DNS, then: "siege shemp" will stress
http://shemp.yourdomain.net/index.html (assuming that "index.html" is
the server specified index). To stress the same page using https proto
col, the minimum URL requirement is this: https://shemp. That URL
specification will lay siege to https://shemp.yourdomain.net/index.html
To hit multiple URLs, place them in a single file. The default URLs
file is $SIEGE_HOME/etc/urls.txt. [You may change that file with the
f option, see above.] In that file list the URLs one per line: