This page looks best with JavaScript enabled

Simple load testing with siege

 ·  ☕ 2 min read

Siege is an open source regression test and benchmark utility. It can stress test a single URL with a user defined number of simulated users, or it can read many URLs into memory and stress them simultaneously. The program reports the total number of hits recorded, bytes transferred, response time, concurrency, and return status. Siege supports HTTP/1.0 and 1.1 protocols, the GET and POST directives, cookies, transaction logging, and basic authentication. Its features are configurable on a per user basis. Stress testing could be performed under any macOS or UNIX system. On Windows systems, you can use it under WSL2.0.
Source code available at GitHub.

Usage

  • Run basic unparametrized loadtest:

    siege example.com
    
  • Run parametrized loadtest with verbose output:

    siege example.com -r1 -c20 -v
    
    • -r1 - tells each siege user how many times it should run. If you choose “-r3”, then each siege user will run three times before exits.
    • -c20 - number of concurrent users.
    • -v - verbose output.
  • Run parametrized loadtest with custom header (e.g. pass token):

    siege example.com -r10 -c20 -H "Cookie: token=fcee1649-28c5-441e-8631-c33c34f99d1a;"
    

Additional options

  • -t NUMm - run the test for a selected period of time. The format is NUMm, where NUM is a time unit and the m modifier 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 itself.
  • -d NUM - each siege simulated user is delayed for a random number of seconds between one and NUM. If you are benchmarking performance, it is recommended that you use a 1 second delay (-d1). The default value is 3. This delay allows for the transactions to stagger rather then to allow them to pound the server in waves.

Read more

Check out author website or the manual page to read more about siege:

man siege
What's on this Page