Siege will not stop when done with urls.txt file

968 Views Asked by At

I'm using siege to locate some problem pages on our new sitemap and am having trouble getting it to stop after it runs through the urls.txt file. I have tried using reps=once in the command line, as well as in the .siegerc config file. I find that I have to use the config file, as I want the output written verbosely to a log file so that I can see page load times, 302 and 404 errors, etc. and import them into excel. However, no matter what I try I cannot get siege to stop when it completes the url.txt file- it just reruns it over again. I have configured for 40 concurrent users, the time and reps variable is commented out in config, the url.txt file is in config. The syntax I run at cmd line is... sudo siege --reps=once -v > outputfile.csv

I have tried setting the reps in config, no luck. Any ideas where I'm going wrong?

2

There are 2 best solutions below

0
On

I ran into similar problems and trying multiple options I got it to work with:

# siege -c 10 -b -r 10 -f urls.txt

where urls.txt is a simple list of URLs like

http://ip-address/url1.html
http://ip-address/url2.html
....
....

The logs were written into a file specified in the siegerc file. ${HOME}/var/siege.log

2016-08-05 17:52:59,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.67,     100,       0
2016-08-05 17:53:00,    100,       0.91,           4,       0.09,      109.89,        4.40,        9.76,     100,       0
2016-08-05 17:53:01,    100,       0.90,           4,       0.09,      111.11,        4.44,        9.78,     100,       0
2016-08-05 17:53:02,    100,       0.89,           4,       0.09,      112.36,        4.49,        9.64,     100,       0
2016-08-05 17:53:03,    100,       0.86,           4,       0.08,      116.28,        4.65,        9.84,     100,       0
2016-08-05 17:53:04,    100,       0.89,           4,       0.09,      112.36,        4.49,        9.80,     100,       0
2016-08-05 17:53:05,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.83,     100,       0
2016-08-05 17:53:06,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.89,     100,       0
2016-08-05 17:53:07,    100,       0.87,           4,       0.09,      114.94,        4.60,        9.79,     100,       0
2016-08-05 17:53:07,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.85,     100,       0

}

I also observed that the logfile option is either buggy or very strict. '-l filename.log' does not work.

$ siege -c 10 -b -r 10 -f urls.txt -l ./siege.log
** SIEGE 2.70
** Preparing 10 concurrent users for battle.
The server is now under siege...
done.
Transactions:                      0 hits
Availability:                   0.00 %
Elapsed time:                   0.08 secs
Data transferred:               0.00 MB
Response time:                  0.00 secs
Transaction rate:               0.00 trans/sec
Throughput:                     0.00 MB/sec
Concurrency:                    0.00
Successful transactions:           0
Failed transactions:             100
Longest transaction:            0.00
Shortest transaction:           0.00

FILE: /home/xxxx/var/siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change
the directive 'show-logfile' to false.

But --log=filename.log works. e.g.

# siege -c 10 -b -r 10 -f urls.txt --log=./siege.log
$ siege -c 10 -b -r 10 -f urls.txt --log=./siege.log
** SIEGE 2.70
** Preparing 10 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200   0.08 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.08 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.09 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.09 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.09 secs:   55917 bytes ==> /create_and_delete_networks.html

done.
Transactions:                    100 hits
Availability:                 100.00 %
Elapsed time:                   0.89 secs
Data transferred:               4.60 MB
Response time:                  0.09 secs
Transaction rate:             112.36 trans/sec
Throughput:                     5.16 MB/sec
Concurrency:                    9.74
Successful transactions:         100
Failed transactions:               0
Longest transaction:            0.15
Shortest transaction:           0.05

FILE: ./siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change

Hope this helps.

0
On

Siege will not stop, this is an expected behaviour... it will do as many laps on the urls files until it reaches the stopping conditions.

The 3 ways to stop siege:

  1. Manual stopping through hitting CTRL+C

  2. You specify time for the run. You can instruct siege to run for 10 seconds or 1 minute

# run for 10 seconds
siege -t 10S -f urls.txt

# run for 2 minutes
siege -t 2M -f urls.txt
  1. The number of repetitions, by specifying -r. (number of requests will be concurrency X repetition
# this will result in 20 requests
siege -r 10 -c2 -f urls.txt

If you need to hit each URL in the file exactly ones you have to do the manual math on your side and utilize -r and -c. to make it add up