siege用法

相信大家对siege还是比较了解的,它是一款比较功能比较强大的压力测试软件。可能大家平常也会用,但直到前阵子,发现自己对它的参数理解还不够深刻,分享出来希望对大家有所帮助。

如果我用以下这样的参数去进行压力测试,具体是怎样的?

siege -r1000 -c20  "127.0.0.1:1823"

是不是“20个并发用户,每个用户重复请求1000次,去压本地的1823端口”。

好的,那接下来的问题来了,每个用户的每个请求之间会不会有延时?如果有延时的话,会不会对得到的性能指标有所影响呢?

这就我们之前很可能忽视的一个参数:

-b, --benchmark         BENCHMARK: no delays between requests.
‘ –delay=NUM ‘
Each siege simulated user is delayed for a random number of seconds between one and NUM. If you are benchmarking performance, it is recommended that you use a 1 second delay ( -d1 ). The default value is three (3 ). This delay allows for the transactions to stagger rather then to allow them to pound the server in waves.

 

所以正确的压力测试参数应该是:

siege -r1000 -c20 -b  "127.0.0.1:1823"

 

参考文章:

http://www.php-oa.com/2010/06/25/siege.html

posted @ 2012-08-14 17:00  lengyuhong  阅读(834)  评论(0编辑  收藏  举报