用siege做http的压力测试

作者: 2hei 发表于2008年7月11日 22:51
版权声明: 可以转载, 转载时务必以超链形式标明文章原始出处和作者信息及版权声明
http://www.2hei.net/mt/2008/07/siege-http-press-test.html

siege是一个开源的压力测试用具,有点类似apache的ab

http://www.joedog.org/Siege/Manual
download from ftp://ftp.joedog.org/pub/siege
 
./configure --prefix=/home/siege && make  && make install

[root@ bin]# ./siege
SIEGE 2.67
Usage: siege [options]
       siege [options] URL
       siege -g URL
Options:
  -V, --version           VERSION, prints version number to screen.
  -h, --help              HELP, prints this section.
  -C, --config            CONFIGURATION, show the current configuration.
  -v, --verbose           VERBOSE, prints notification to screen.
  -g, --get               GET, pull down headers from the server and display HTTP
                          transaction. Great for web application debugging.
  -c, --concurrent=NUM    CONCURRENT users, default is 10
  -u, --url="URL"         Deprecated. Set URL as the last argument.
  -i, --internet          INTERNET user simulation, hits the URLs randomly.
  -b, --benchmark         BENCHMARK, signifies no delay for time testing.
  -t, --time=NUMm         TIME based testing where "m" is the modifier S, M, or H
                          no space between NUM and "m", ex: --time=1H, one hour test.
  -r, --reps=NUM          REPS, number of times to run the test, default is 25
  -f, --file=FILE         FILE, change the configuration file to file.
  -R, --rc=FILE           RC, change the siegerc file to file.  Overrides
                          the SIEGERC environmental variable.
  -l, --log               LOG, logs the transaction to PREFIX/var/siege.log
  -m, --mark="text"       MARK, mark the log file with a string separator.
  -d, --delay=NUM         Time DELAY, random delay between 1 and num designed
                          to simulate human activity. Default value is 3
  -H, --header="text"     Add a header to request (can be many)
  -A, --user-agent="text" Sets User-Agent in request
 
 
  siege 的使用方法
 
  $ ./siege -u www.google.com -d1 -r10 -c25
  -u has been deprecated.
  提示-u参数已经不推荐了
 
也可以使用url列表的方式:

  ./siege -c 20 -r 30 -f url.txt
 
 
 vi url.txt
  http://www.google.com

运行的结果如下:

** SIEGE 2.67
** Preparing 20 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200   0.17 secs:    6385 bytes ==> /
HTTP/1.1 200   0.17 secs:    6385 bytes ==> /
HTTP/1.1 200   0.17 secs:    6385 bytes ==> /
HTTP/1.1 200   0.17 secs:    6385 bytes ==> /
HTTP/1.1 200   0.17 secs:    6375 bytes ==> /
HTTP/1.1 200   0.17 secs:    6375 bytes ==> /
HTTP/1.1 200   0.18 secs:    6385 bytes ==> /
HTTP/1.1 200   0.18 secs:    6375 bytes ==> /
HTTP/1.1 200   0.33 secs:    6385 bytes ==> / 
  done.
Transactions:                    600 hits
Availability:                 100.00 %
Elapsed time:                  24.53 secs
Data transferred:               3.66 MB
Response time:                  0.18 secs
Transaction rate:              24.46 trans/sec
Throughput:                     0.15 MB/sec
Concurrency:                    4.46
Successful transactions:         600
Failed transactions:               0
Longest transaction:            3.40
Shortest transaction:           0.17
 
FILE: /home/siege/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.

| | Comments (0) | TrackBacks (0)

发表一个评论

关于这篇文章

这篇文章由2hei2008年7月11日 22:51发布.

上一篇:使用Jconsole对java的内存使用情况(JVM)进行监控

下一篇:use Volano对jvm的性能进行测试

回到首页 或者查看归档文章