Web压力测试工具Siege介绍

34,915浏览
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Siege是我所用过的一款不错的网站压力测试工具,它可以非常容易地定制并发访问人数以及并发时间,安装、使用也非常方便,当然它是在Linux环境下使用的,下面来对它作一个介绍。

官方网址:http://www.joedog.org/

下载网址:ftp://ftp.joedog.org/pub/,进入到ftp://ftp.joedog.org/pub/siege/下载最新版:

siege-2.70.tar.gz

安装解压:tar zxvf siege-2.70.tar.gz,进入到解压后的目录:siege-2.70,运行命令:

./configure

make

make install

安装完毕后如果有错误,则按照提示信息处理即可(有可能会出现错误,我安装的时候就报了错,不过有很清楚地提示信息)。

输入:siege –help,如果安装没问题会出现以下类似信息:

SIEGE 2.70

Usage: siege [options]

siege [options] URL

siege -g URL

Options:

-V, –version           VERSION, prints the version number.

-h, –help              HELP, prints this section.

-C, –config            CONFIGURATION, show the current config.

-v, –verbose           VERBOSE, prints notification to screen.

-g, –get               GET, pull down HTTP headers and display the

transaction. Great for application debugging.

-c, –concurrent=NUM    CONCURRENT users, default is 10

-i, –internet          INTERNET user simulation, hits URLs randomly.

-b, –benchmark         BENCHMARK: no delays between requests.

-t, –time=NUMm         TIMED testing where “m” is modifier S, M, or H

ex: –time=1H, one hour test.

-r, –reps=NUM          REPS, number of times to run the test.

-f, –file=FILE         FILE, select a specific URLS FILE.

-R, –rc=FILE           RC, specify an siegerc file

-l, –log[=FILE]        LOG to FILE. If FILE is not specified, the

default is used: PREFIX/var/siege.log

-m, –mark=”text”       MARK, mark the log file with a string.

-d, –delay=NUM         Time DELAY, random delay before each requst

between 1 and NUM. (NOT COUNTED IN STATS)

-H, –header=”text”     Add a header to request (can be many)

-A, –user-agent=”text” Sets User-Agent in request

Copyright (C) 2010 by Jeffrey Fulmer, et al.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS

FOR A PARTICULAR PURPOSE.

上面也是运行的一些参数,右边是对一些参数的解释说明

比如:

–C :查看siege当前的配置信息

–V:版权说明信息

–c:并行启动(访问)用户数,默认是10

-t:压力测试时间,比如-t5表示持续时间是5分钟

-r:每个连接发出的请求数量,这个与t有些类似,所以设置了这个值就不需要设置t了,反之亦然。

-f:对应一个文件,这个文件里每一行为一个URL链接,格式如:

http://www.zihou.me

http://www.zihou.me/2010/12/16/2821/

http://www.zihou.me/2010/12/14/2806/

好了,主要的一些参数说明就介绍这么多,其余的可以参考上面的英文。

使用:

1、  启动100个用户(线程)在5分钟内对某一页面www.zihou.me进行并发访问

siege http://www.zihou.me -c200 -t5

2、  对多个页面进行并发访问

新建一个文件urls,里面的内容为(只是例子,任何url都可以):

http://www.zihou.me

http://www.zihou.me/2010/12/16/2821/

http://www.zihou.me/2010/12/14/2806/

siege -f urls -c200 -t5

表示启动200个用户在5分钟内并发访问以上的url网址。

并发测试完毕后,会打印出一些结果信息:

Lifting the server siege…      done.

Transactions:                   7555 hits

Availability:                  99.47 %

Elapsed time:                 299.92 secs

Data transferred:              99.17 MB

Response time:                  7.30 secs

Transaction rate:              25.19 trans/sec

Throughput:                     0.33 MB/sec

Concurrency:                  183.84

Successful transactions:        7555

Failed transactions:              40

Longest transaction:           17.94

Shortest transaction:           0.02

如果在并发的过程中,被访问的页面打开出错或及其缓慢,表示在当前并发条件下,被访问网站是不能承受的,也就是抗并发能力弱。

另外,在并发的过程中最好通过top命令来查看CPU和Memory的占用情况。

4 billion in sales in five minutes of singles’ dayThey also ignore the quickly raising dividend, and the share repurchase programs.. Is a nation of gastrointestinally challenged people. Streams are up 37% in 2016 compared with last year, reaching 7.4 million unique devices a month. But the backs were all young, considering sophomore Gerald Holmes was the most experienced of the three main ball carriers, and all looked solid at various points.. Calder solo hablo de la corrupci e impunidad de los gobiernos pasados durante su sexenio. And this was a favorable audience. The 2001 team had just four Pro Bowlers, and only Troy Brown was a first team All Pro (as a punt returner); the 2003 champions had just three Pro Bowlers and three All Pros; while the final title team had six Pro Bowlers and two All Pros. Fans now expect to have their bags searched and examined with metal detecting hand wands whenever they enter a venue.. This functional core exercise is the figure eight abdominals with the medicine ball. And I don’t think I have.”. We’re going to step in, turn the supporting foot for maximum flexibility, lift the knee and striking with the heel this time, and again and go, and one more, go, good. Since Bundy was the lawyer as well as the accused, the judge excused him from wearing restraints so he would be able to move around Authentic Jerseys Wholesale the courtroom. Then again, he was under steady pressure for much of the half, though I wouldn’t call it under siege. But at a purchase price of $150 million, does this acquisition bring enough to wholesale jerseys the table for Under Armour?. Fake ray bans If you’re using Baratas Replicas Ray Ban an antenna, have checked all of the above steps and still aren’t getting a good signal, there’s a good chance it’s because of inclement weather outside. The genomic arrangement of the fifteen P450 genes is exactly the same as in A. Cutler is surely used to it by now. The Cowboys suffered from a bad defense, which ended with a score in favor of the 49ers 28 3 in the second quarter. Troublesome, sure, but nothing life threatening going on. This is cheap ray ban Sunglasses Online a very quick way of arresting human attention. And as a note, we deferred $36 million into Q4 from programs that allowed consumers to upgrade from current generation titles to next generation titles. Navy and most notably organized and oversaw the missionto kill Osama bin Laden in May 2011 as the commander of the Joint Special Operations Command. In fact, generally speaking, nobody knows Wholesale NFL Jerseys much of anything about them. Further, a growing number of customers are shutting off traditional video content Replica ray ban Sunglasses sale services in favor of alternatives such as Netflix and original content from Amazon..

如无转载说明,则均为本站原创文章,转载请注明:来源:子猴博客

相关内容

《Web压力测试工具Siege介绍》有3个想法

发表评论

电子邮件地址不会被公开。 必填项已用*标注


*

酷!左边勾选上复选框,评论里将显示你博客文章!
:wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-D :-? :) :( :!: 8-O 8)

Upload Files

你可以上传一张或多张图片,这些图片将附在你评论里