|
Downloads:
♦ Europe
Downloads:
♦ Europe
♦ Europe
♦ Europe
|
SIEGE, AN HTTP REGRESSION
Siege is an http/https regression testing and benchmarking utility. It was designed to let web developers measure the performance of their code under duress, to see how it will stand up to load on the internet. It lets the user hit a web server with a configurable number of concurrent simulated users. Those users place the webserver "under siege." The duration of the siege is measured in transactions, the sum of simulated users and the number of times each simulated user repeats the process of hitting the server. Thus 20 concurrent users 50 times is 1000 transactions, the length of the test. Performance measures include elapsed time of the test, the amount of data transferred ( including headers ), the response time of the server, 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 essentially three modes of operation, regression, internet simulation and brute force. It can read a large number of URLs from a configuration file and run through them incrementally ( regression ) or randomly ( internet simulation ). Or the user may simply pound a single URL with a runtime configuration at the command line ( brute force ). The format for invoking siege is: siege options... siege supports the following command line options: ' -V ' ' -h ' ' -C ' ' -v ' ' -g URL ' ' -c NUM ' ' -i ' ' -t NUMm ' ' -f FILE ' ' - l ' ' - m MESSAGE ' ' -d NUM ' Beginning with version 2.00, siege supports a settings configuration file in which you can store most of your command line options. This makes it much easier to invoke siege and it helps you ensure that every run in a series of runs has the exact same settings. Where is it? The siege configuration file is called .seigerc and it is located in the home directory directory of the user who installed siege. If you did not install siege but you want to use it, then run the command "siege.config". That will put a template .siegerc file in your home directory. You can edit the settings with your favorite editor. The .siegerc file which is generated by the siege.config utility is well documented with comments describing the directives. Those comments should be all you need to get started. Siege understands the following URL format: [protocol://] [servername.domain.xxx] [:portnumber] [/directory/file] Currently, siege only supports http and https protocols. HTTP is the default protocol and therefore does not require a protocol specification. Frankly siege allows you to cheat. The minimum 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 -u shemp will stress http://shemp.yourdomain.net/index.shtml ( assuming that is the server specified index ). If you want to lay siege to https servers, then it is necessary to specify the protocol. In the above example, siege -u https://shemp Will lay siege to https://shemp.yourdomain.net/index.shtml given the assumptions stated above. In order to run a regression test or an effective internet simulation, you are going to have to run through the URLs on the server you are testing. To accomplish that, place the URLs in a configuration file. The default file is SIEGE_HOME/etc/urls.txt. In that file list the URLs one per line:
http://homer.whoohoo.com/index.shtml http://homer.whoohoo.com/howto.jsp http://homer.whoohoo.com/cgi-bin/hello.pl?first=bart&last=simpson
Siege-2.06 and later supports both POST and GET directives. GET directives are constructed as shown above, but POST directives require the POST keyword. Construct POST directives as follows: http://homer.whoohoo.com/cgi-bin/hello.pl POST name=homer http://homer.whoohoo.com/haha.jsp POST word=doh!&scope=ALL When invoked without the URL option [ -u URL | --url=URL ], siege looks for URLs in a file. It reads it into memory and runs through the URLs. Normally siege starts at the beginning of the file and works it way through it sequentially. If you specify internet mode [ -i | --internet ], then it selects URLs randomly. An alternative file can be selected at run time with the [ -f FILE | --file=FILE ] option. Beginning with release 2.57, siege supports variable declaration and evalutation in both the .siegerc file and the urls.txt file. Siege employs variable syntax similar to UNIX shell. They are declared one per line in the file:
varname=value
To refererence a varaible, you must place it inside $() or ${}. In the example above, type $(varname) to access value. You can use variables to switch between two protocols with one quick edit in your urls.txt file. For example:
PROT=https:// When siege is invoked with logging enabled [-l/--log], the program records the transaction in PREFIX/var/siege.log where PREFIX is the directory in which siege was installed. ( see the file INSTALL for instructions. ) The transaction logged is similar to standard output display at the end of every siege run. However, the information is arranged in comma separated text for easy import into a spread sheet. The logging option enables you to maintain history and chart progress over time. In order to group runs by conditions such as URL, server or even protocol, the -m "message"/--mark="message" option was added. This places the mark "message" in the log file. So that if you switched your testing from http to https, you could mark the log with "start HTTPS testing" -m/--mark assumes logging and makes the -l/--log option unnecessary. Performance measures include elapsed time of the test, the amount of data transferred ( including headers ), the response time of the server, 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. The reporting format is modeled after Lincoln Stein's torture.pl script. This is a sample of siege output:
Transactions is the number of server hits. In the example, 25 simulated users [ -c25 ] each hit the server with 10 repetitions [ -r10 ], a total of 250 transactions. Elapsed time is the duration of the entire siege test. This is measured from the time the user invokes siege until the last simulated user completes its transactions. Shown above, the test took 14.67 seconds to complete. Data transferred is the sum of data transferred to every siege simulated user. It includes the header information as well as content. Because it includes header information, the number reported by siege will be larger then the number reported by the server. In internet mode, which hits random URLs in a configuration file, this number is expected to vary from run to run. Response time is the average time it took to respond to each simulated user's requests. Transaction rate is the average number of transactions the server was able to handle per second, in a nutshell: transactions divided by elapsed time. Throughput is the average number of bytes transferred every second from the server to all the simulated users. Concurrency is average number of simultaneous connections, a number which rises as server performance decreases. Successful transactions is the number of times the server returned a code less then 400. Accordingly, redirects are considered successful transactions. New release annoucements are made on freshmeat.net. To sign up for new release information, click HERE. New versions are available for download via anonymous FTP, click HERE for downloads. Multi-threaded siege was built and tested successfully on the following platforms: AIX( powerpc-ibm-aix4.2.1.0 ) Siege has been built and tested successfully using IBM C for AIX version 5. It currently does not support gcc on that platform. GNU/Linux( i[56]86-pc-linux-gnu ) Siege was originally developed on SuSE GNU/Linux with gcc, there are no known issues on this platform. HP-UX ( hppa2.0w-hp-hpux11.00 ) Siege has been built on this platform with both the HP ANSI C compiler and gcc. Solaris( sparc-sun-solaris2.[678] ) Siege LOVES this platform. It was built and tested successfully using gcc. Microsoft Windows( pc-i686-cygwin ) Siege was ported to Cygwin by Funkman. It runs nicely on all versions greater than or equal to 1.5. Jeffrey Fulmer -- Designed and implemented Siege in his position as Webmaster for Armstrong World Industries License information Please consult the file, COPYING for complete license information.
Copyright (C) 2000-2003 Jeffrey Fulmer
Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn. Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them.
|
Support JoeDog's software is free, but not his operating costs. Please consider a PayPal donation and promote free software. ![]() ![]()
J. Drape Lauren Tippett |