JoeDog / siege

Siege is an http load tester and benchmarking utility
GNU General Public License v3.0
5.91k stars 386 forks source link

siege does not seem to honor --delay #171

Closed sunilvaltix closed 3 years ago

sunilvaltix commented 4 years ago

[centos@localhost]$ time siege -t10S -d 5 -c 1 "https://:/index.html.1MB" SIEGE 4.0.2 Preparing 1 concurrent users for battle. The server is now under siege... HTTP/1.1 200 0.03 secs: 1047682 bytes ==> GET /index.html.1MB HTTP/1.1 200 0.03 secs: 1047682 bytes ==> GET /index.html.1MB HTTP/1.1 200 0.03 secs: 1047682 bytes ==> GET /index.html.1MB HTTP/1.1 200 0.03 secs: 1047682 bytes ==> GET /index.html.1MB HTTP/1.1 200 0.03 secs: 1047682 bytes ==> GET /index.html.1MB HTTP/1.1 200 0.03 secs: 1047682 bytes ==> GET /index.html.1MB

Lifting the server siege... Transactions: 6 hits Availability: 100.00 % Elapsed time: 9.29 secs Data transferred: 5.99 MB Response time: 0.03 secs Transaction rate: 0.65 trans/sec Throughput: 0.65 MB/sec Concurrency: 0.02 Successful transactions: 6 Failed transactions: 0 Longest transaction: 0.03 Shortest transaction: 0.03

WIth delay of 5 seconds, how is it able to send and get 6 transactions in 10 second?

JoeDog commented 4 years ago

See the man page. Delay isn't captured in the statistics. The clock starts on the transaction after the delay is over

sunilvaltix commented 4 years ago

Is every page request supposed to see the delay or not? The question is not about stats at all. The question is how did it send 6 requests in 10 seconds when each request is supposed to have a delay of 5 seconds?

sunilvaltix commented 4 years ago

-d NUM, --delay=NUM This option instructs siege how long to delay between each page request. The value NUM represents the number of seconds between each one. This number can be a decimal value. In fact the default is half a second (--delay=0.5).

The time between delay requests is NOT applied toward the transaction time. If two 0.1 second transactions have a 2 second delay between them, their average transaction time is run is 0.1 seconds. It is applied toward the total elapsed time. In this scenario, the elapsed time would be 2.2 seconds.

NOTE: when the parser is enabled (see: -p/--parser), there is no delay between the page and its elements, i.e., style sheets, javascripts, etc. The delay is only between page requests. 
sunilvaltix commented 4 years ago

The man page is actually wrong...:-) The code is doing a random number.

Basically, I was looking to use the delay as a rate enforcer...fire requests at 5ms to get a 200 request per second.