With "web pressure measurement" keyword search, can find a lot of tools for pressure measurement, such as AB, Http_load, Webbench, siege these, but today is not to compare these tools, after all, we just want a result. " This article mainly introduces siege, because siege is the above four, on the Mac installed and use the most convenient, so decisive is it!
Preparatory work
Before the test starts, you need to make sure that you are open files
big enough, otherwise you will report an TOO MANY FILES OPEN
error that can be ulimit -a
viewed, such as:
Use ulimit -n 10000
to modify the value. However, this modification is not permanent, closing the terminal session and restoring it back.
Installation
brew install siege
Use
siege -c 1000 -t 5s URLsiege -c 1000 -t 5s -f URL_File_Name
The above is siege
the two methods of use, the first is to test the specified site, the second is a number of URLs contained in the file for batch testing.
-c
Concurrency number
-t
The pressure test time can be added to the unit after the time, the specific help, the above indicates that the pressure measurement time lasts 5 seconds
-r
Repeat the number of times, and the -t
expression is different, but the same meaning, set a can
-f
Contains the text name of the URL
-b
Benchmark mode, no delay between requests
Output results
Transactions total number of tests
Availability Success Rate
Elapsed Time Total
Data transferred Total transfer
Response Time Responses
Transaction rate processing Requests per second
Throughput average data transfer per second
Concurrency actual maximum concurrency
Successful transactions successful processing times
Failed transactions number of failed processing requests
Longest transaction The longest time to transfer
Shortest transaction The shortest time spent in transmission
Finally, the following Siege can support Get/post two kinds of requests, but the format is slightly different, and the above list is only Siege part of the parameters, Siege there are many other parameters, please refer to the manual.
Tool: Use siege to do Web server pressure test