It was created to give developers the ability to performance of their code in conditions as close to real. Just Siege can simulate the treatment site to multiple users. This keeps the server as though "under siege" for a long time. The number of requests made under "siege" is calculated from the total number of users and number of trips to the server. Such as 20 concurrent users 50 times for a total of 1,000 requests. The output of the post-test includes the time taken to check the total amount of data transferred (including headers), the server response time, its capacity and number of times it returned OK 200. These data and reported at each inspection. Details are described below.
Siege has three main models of work – the mode of regression testing, internet simulation, and brute force. It can read a reference from a configuration file and run it at a time (regression) or accidentally (internet simulation). Or the user can specify a single address to which all calls will be made – brute force.
Format starting next Siege: «siege options."
The program can take the following parameters:
‘-V’
‘-Version’
Displays the current version.
‘-H’
‘-Help’
Displays help.
‘-C’
‘-Config’
Displays the current configuration. Siege reads the configuration and displays their contents. You can change them by editing the file $ HOME / .siegerc. If the file you have, you should run the utility siege.config, that it generates
‘-V’
‘-Verbose’
Detailed output. If this option is enabled Siege will display a detailed information on all calls to the server. It includes the type of HTTP-protocol, the response code and address of the treatment. Example:
HTTP/1.1 200 OK: / cgi-bin/whoohoo.cgi? First = Homer & last = simpson
This option is especially useful in case of regression or the Internet, when the program is in a range of addresses.
‘-G URL’
‘-Get URL’
Takes a reference to the link. Gets the headers from the server and displays them on screen. A great tool for debugging.
‘-C NUM’
‘-Concurrent = NUM’
The number of simulated users. This option allows you to test your Web server with the number of concurrent users specified in NUM. The amount is limited only by computer resources, but in practice for a good result you want to simulate a couple of hundreds of user sessions. Remember that in any configuration you still can not imitate the behavior of real people. If only because they linger on every page, reading the information, and not’ve requested one at a time.
‘-I’
‘-Internet’
This option is used with a configuration file containing lots of links. When you turn it on Siege randomly selects addresses complaints and makes inquiries to them. In reality, you can not tell which pages users and in what order they should go. They will always do it differently. Internet mode tries to emulate this behavior. Note that in the process of testing to some addresses from the file can not happen at all applications because they are chosen at random.
‘-T NUMm’
‘-Time = NUMm’
The time it takes to be tested. Is in the form «NUMm», where NUM is the number of units of time, and «m» is a modifier S, M, or H for seconds, minutes and hours. For example, in order to start testing for an hour, you can use the following combinations:-t3600S,-t60M,-t1H. The modifier is not case sensitive, but between him and the number should be no spaces.
‘-F FILE’
‘-File = FILE’
The configuration file contains references (SIEGE_HOME / etc / urls.txt). You can use this option in order to point to another path. For example:
siege-file = serverb.txt
‘- L’
‘-Log’
This option specifies that it should Siege record all information in the log file SIEGE_HOME / var / siege.log. Each new file will be appended.
‘- M MESSAGE’
‘-Mark = MESSAGE’
This option allows you to specify an expression which will divide a record of different tests in the log file. Along with it is not necessary to use the option-l, because it will be included automatically. If the MESSAGE has spaces do not forget to put it in quotes.
‘-D NUM’
‘-Delay = NUM’
This option specifies the delay between calls simulated user. The delay time is calculated from one to the entered number. When tested in demanding applications it is desirable to put parts of the delay is second (-d1). The default delay is 1 second to 3. This option allows a server to cover waves requests.
Starting with version 2.00 Siege supports configuration files in which you can store often-used commands. This can help a lot of testing with almost the same settings. This file is called. Seigerc and is located in the user’s home directory created the Siege. If this file is not there (like you do not have installed the program) you can use a utility siege.config to create it. Inside the file are various directives with their comments. Editing can be performed using any text editor.
Siege understands the following format options:
[Protocol: / /] [server.domen.xxx] [: port] [/ dierktoriya / file]
Addresses are supported only with HTTP and HTTPS. The minimum that you must specify – server name. If you’re inside some domain, and testing a server named shemp, he is registered in your hosts file or in the local DNS, then the command
"Siege-u shemp" make an appeal to the address shemp.domen.net / index.shtml. If you want Siege worked with https-server then you need to specify an additional protocol and. Thus the command "siege-u https://shemp" will make the program contact https://shemp.yourdomain.net/index.shtml.
Before running a regression test or internet mode you need to transfer the program to scan a list of addresses. To do this, place them in a file SIEGE_HOME / etc / urls.txt. It addresses must be placed one per line:
homer.whoohoo.com / howto.jsp
homer.whoohoo.com / index.jsp
homer.whoohoo.com / cgi-bin / hello.pl? first = bart & last = simpson
etc.
Siege-2.06 and later supports the existence of GET and POST directives. GET directive is used by default and specify it is not necessary. But for the POST-request should specify the directive. Example:
homer.whoohoo.com / cgi-bin / hello.pl POST name = homer
homer.whoohoo.com / haha.jsp POST word = doh! & scope = ALL
When you run the program without the option [-u URL | - url = URL], it takes the address is out of this. In normal mode, Siege begins with the beginning of the file and is gradually drawn to each address. If you choose internet simulation [-i | - internet], then refer to the addresses occur randomly. You can specify a different path to the links via the option [-f FILE | - file = FILE].
Variables:
Beginning with the release of version 2.57, Siege supports the declaration of variables in the file. Siegerc and files with links (urls.txt). The syntax for declaring variables Siege similar to the syntax UNIX shell. They relate to one string in the format "varname = value"
Variable name is placed inside the $ () or $ {}. You can use them for example to quickly switch between the two protocols to scan links:
PROT = https://
$ (PROT) eos.joedog.org / siege / index.php
$ (PROT) eos.joedog.org / wacky / index.php
$ (PROT) eos.joedog.org / scout / index.php
$ (PROT) eos.joedog.org / libping / index.php
$ (PROT) eos.joedog.org / gunner / index.php
In this example, to change the protocol of all references, you need to change just one line.
When Siege starts with the option of logging [-l/--log], the program puts all output in PREFIX / var / siege.log, where PREFIX – install directory Siege (see the file INSTALL). In the log file is written that all the program’s output to the screen in standard mode. Information in records are separated by commas for easy import into other formats.
To separate the results of different tests have the option-m "text" /-mark = "text". It puts the specified message in the log file before scanning so you can quickly find the result. For example, if you test the links on the protocols http and https, you can leave your mark in the log-type "start HTTPS testing". If you use the parameter option -m/-mark -l/-log use is not mandatory.
Statistics Research:
Statistics provided by the program includes a total time of testing, the total amount of data transferred (including headers), the server response time, its capacity and the number of hits on the server responded Code 200. The report itself is formed by Lincoln Stein script (Lincoln Stein) torture.pl. Here is a sample Siege:
Ben: $ siege-u shemp.whoohoo.com / Admin.jsp-d1-r10-c25
.. Siege 2.65 2006/05/11 23:42:16
.. Preparing 25 concurrent users for battle.
The server is now under siege … done
Transactions: 250 hits
Elapsed time: 14.67 secs
Data transferred: 448,000 bytes
Response time: 0.43 secs
Transaction rate: 17.04 trans / sec
Throughput: 30538.51 bytes / sec
Concurrency: 7.38
Status code 200: 250
Successful transactions: 250
Failed transactions: 0
Here:
Transactions – the number of calls to the server. In the example this number is calculated from 25 user [-c25] Run the 10 hits [-r10], for a total of 250.
Elapsed time – total time of testing. It is calculated from the first trip to the server and ending with obtaining the answer to the last request. In the example, the test took 14.67 seconds.
Data transferred – the total amount of data transferred by all the simulated users. It includes a request body, and their titles.
Response time – average time for which the server could reply to the client.
Transaction rate – the average number of the server time to process per second. It is obtained by dividing the total number of requests for time spent.
Throughput – the average number of data transmitted every second from the server to users.
Concurrency – the number of simultaneous connections for which the server responds with no delay.
Successful transactions – the number of requests to the server responded less code 400.
Multi-threaded Siege was collected and successfully tested extensively on the following platforms:
AIX (powerpc-ibm-aix4.2.1.0). Siege built and successfully tested using a compiler "IBM C for AIX" version 5.
GNU / Linux (i [56] 86-pc-linux-gnu). Siege was developed on SuSE GNU / Linux with gcc.
HP-UX (hppa2.0w-hp-hpux11.00) Siege has been compiled on this platform using the "HP ANSI C compiler" and gcc.
Solaris (sparc-sun-solaris2. [678]) Siege loves this platform. She was on her normally compiled with gcc.
Microsoft Windows (pc-i686-cygwin) Siege has been ported to Cygwin Funkman `th. It normally works after all versions of Siege 1.5.
Jeffrey Fulmer – Designed and implemented in post Siege being a web master in the company "Armstrong World Industries".
For complete information about license see the file COPYING. Copyright wholly owned by Jeffrey Fulmer (Jeffrey Fulmer). Each is allowed to produce and distribute copies of this document without any changes. Allowed to change this document and distribute modified versions of it only when you specify the changed locations.