Siege is a stress testing tool for Web servers

Siege is a stress testing tool for Web servers
April 15 12:30 2011 Print This Article

Siege is a utility for stress testing webservers. It was created to give developers the ability to check the resource consumption of its code in conditions close to real. Siege also can use the site to simulate multiple users.

Startup Parameters

Format launch Siege following: “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.

‘-V’
‘-Verbose’
A detailed derivation of the information. If this option is enabled Siege will display 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 the case of regression or simulate the Internet, when the program goes to a wide range of addresses.

‘-G URL’
‘-Get URL’
Commits an address to the link. Gets the headers from the server and displays them on screen. It is a great tool for spot testing.

‘-C NUM’
‘-Concurrent = NUM’
Number of simulated users. Option allows you to test your Web server with the number of concurrent users specified in NUM.

‘-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.

‘-T NUMm’
‘-Time = NUMm’
Time for which the testing should be run. 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 respectively.

‘-F FILE’
‘-File = FILE’
The configuration file contains references (SIEGE_HOME / etc / urls.txt). You can use this option to specify a different path. For example:

siege-file = serverb.txt

‘- L’
‘-Log’
This option specifies the Siege that it must record all information in the log file SIEGE_HOME / var / siege.log. With each new test file will be appended.

‘- M MESSAGE’
‘-Mark = MESSAGE’
This option allows you to specify an expression which will divide a record of different testing in the log file. Together with this it is not necessarily use the option-l, because it will be included automatically. If the expression contains spaces in the MESSAGE not forget to put it in quotes.

‘-D NUM’
‘-Delay = NUM’
This option specifies the delay between calls simulated users to the server. The delay time is calculated from the unit before the introduction of a number.

Configuration file

Starting with version 2.00 Siege supports configuration files in which you can store frequently-used commands. This can help a lot of testing with almost the same settings. This file is called .Seigerc and is located in your home directory user to install Siege.

Format of transmitted URL

Siege understands the following format options:

[Protocol: / /] [server.domen.xxx] [: port] [/ dierktoriya / file]

Addresses are supported only with HTTP and HTTPS. At least you have to specify the server name. If you’re inside of a domain name and test server named shemp, and it’s in your hosts file or in the local DNS, then the command “Siege-u shemp” make an appeal to address shemp.domen.net / index.shtml. If you want Siege worked with https-server then you need to specify an additional and protocol. Thus the command “siege-u https: / / shemp” make the program contact us at https: / / shemp.yourdomain.net / index.shtml.

File with other links

Before running regression test or simulation mode Internet you need to pass the program a list of verifiable 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.

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 of declaring of variables Siege is similar to the syntax of UNIX shell. They announced one per line in the format “varname = value”
Variable name is placed into the $ () or $ {}. You can use them e.g. for fast switching between the two protocols checked 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 links you need to change just one line.

Log File

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 program output to the screen in standard mode. Information when writing is comma-delimited for easy import into other formats.

Platforms

Multi-threaded Siege was assembled and successfully tested extensively on the following platforms:

* AIX (powerpc-ibm-aix4.2.1.0). Siege compiled and tested successfully using the 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 was compiled on this platform using the “HP ANSI C compiler”, and gcc.
* Solaris (sparc-sun-solaris2. [678]) Siege loves this platform. It was normally compiled on it using gcc.
* Microsoft Windows (pc-i686-cygwin) Siege has been ported to Cygwin Funkman `om. It is normally run all versions of Siege after 1.5.

QATestLab, an independent provider of QA and software testing services, conducts load, stress and performance testing of software products. More about our services you can find here.

Related Posts:

About Article Author

view more articles
Nataliia Vasylyna
Nataliia Vasylyna

View More Articles

0 Comments

write a comment

No Comments Yet!

You can be the one to start a conversation.

Add a Comment

Your data will be safe! Your e-mail address will not be published. Also other data will not be shared with third person.
All fields are required.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.