Introduction to Siege
Introduction
Siege is a load testing and benchmarking tool for Linux, designed for web developers to evaluate how well an application holds up under stress. It can be configured to perform concurrent access by multiple users against a web site, recording the response time of every request for each user, and repeating this under a given number of concurrent users. It supports multiple connections as well as GET and POST requests.
Installation
- Mac OSX
1
brew install siege
- Ubuntu
1
aptitude install siege
Parameters
1 | -c: Simulate N concurrent users accessing the target |
siege -c 200 -r 100 http://www.google.comsiege -c 200 -r 100 -f urls.txtsiege -c 200 -r 100 -f urls.txt -isiege -c 200 -r 100 -f urls.txt -i -bdelay=0, a more accurate stress test rather than a functional testsiege -H "Content-Type:application/json" -c 200 -r 100 -f urls.txt -i -b
Result Explanation
1 | Transactions: 20 hits # Total number of tests performed |
Tips
When sending a POST request, the URL format is:
http://www.xxxx.com/ POST p1=v1&p2=v2
If the URL contains spaces or non-ASCII characters, it must be encoded first.