美文网首页
压力测试工具siege

压力测试工具siege

作者: 天草二十六_简村人 | 来源:发表于2019-11-01 14:24 被阅读0次

一、下载并安装
官方下载地址:http://download.joedog.org/siege/
安装和验证:

~/Downloads/siege-4.0.4$ ./configure
~/Downloads/siege-4.0.4$ make 
~/Downloads/siege-4.0.4$ make install 

注意:如果你不是root用户,需要sudo

~/Downloads/siege-4.0.4$ sudo make install 
~/Downloads/siege-4.0.4$ siege -version
siege: invalid option -- 'e'
New configuration template added to /home/xxx/.siege
Run siege -C to view the current settings in that file
siege: invalid option -- 'e'
SIEGE 4.0.4
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.
  -q, --quiet               QUIET turns verbose off and suppresses output.
  -g, --get                 GET, pull down HTTP headers and display the
                            transaction. Great for application debugging.
  -p, --print               PRINT, like GET only it prints the entire page.
  -c, --concurrent=NUM      CONCURRENT users, default is 10
  -r, --reps=NUM            REPS, number of times to run the test.
  -t, --time=NUMm           TIMED testing where "m" is modifier S, M, or H
                            ex: --time=1H, one hour test.
  -d, --delay=NUM           Time DELAY, random delay before each requst
  -b, --benchmark           BENCHMARK: no delays between requests.
  -i, --internet            INTERNET user simulation, hits URLs randomly.
  -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.
                            between .001 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
  -T, --content-type="text" Sets Content-Type in request
      --no-parser           NO PARSER, turn off the HTML page parser
      --no-follow           NO FOLLOW, do not follow HTTP redirects

Copyright (C) 2017 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.

二、示例分析
1、模拟客户端okhttp连接池中只有一个连接复用的场景
测试目标:连接复用是否会请求超时,连接的存活时间长短和局域网网络设备参数配置,它们对客户端程序的影响大小。


image.png
~/Downloads/siege-4.0.4$ siege -d 180 -r 2 -c 1 -v http://bgp.test.com

Transactions: 2 hits
Availability: 100.00 %
Elapsed time: 212.05 secs 测试耗时
Data transferred: 0.02 MB 数据传输量
Response time: 0.02 secs 平均响应时间
Transaction rate: 0.01 trans/sec 每秒事务处理量
Throughput: 0.00 MB/sec 吞吐率
Concurrency: 0.00 并发用户数
Successful transactions: 2
Failed transactions: 0
Longest transaction: 0.03 最长响应时间
Shortest transaction: 0.02 最短响应时间

如果上述第二次请求出现超时,如下所示


image.png

就需要进一步跟踪局域网的中间设备的配置参数了。

下面给出华为AR2200路由器,tcp和http协议的默认超时时间。


image.png

注意到tcp连接超时时间为600秒,但是http的超时时间为120秒,小于siege的delay 时间,从而导致第二次的请求超时。


image.png

这里补充下android客户端关于okhttp的连接池的默认值:
keepalive为5分钟,也即300秒。连接复用技术,如果一个连接是空闲状态,且存活期内,那么客户端将复用该http连接。

2、随机选取testUrls.txt中的网址,进行压力测试。
// -b,更准确的压力测试,而不是功能测试
siege -c 1000 -r 50 -f testUrls.txt -i -b

相关文章

  • Siege高性能压测工具

    前言 Siege是一款高性能的Http压力测试工具。Siege支持身份验证、cookies、http、https和...

  • 使用MySQLslap命令对MySQL做压力测试

    备注:前面我们有文章介绍web服务器的压力测试工具siege,今天来介绍下MySQL的压力测试工具mysqlsla...

  • 性能测试之siege

    一、siege介绍 Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配...

  • 压力测试工具siege

    官网链接:https://www.joedog.org/siege-home 参考文档:http://blog.c...

  • 压力测试工具 -Siege

    Siege是我所用过的一款不错的网站压力测试工具,它可以非常容易地定制并发访问人数以及并发时间,安装、使用也非常方...

  • 压力测试工具Siege

    常见的压力测试工具有很多,在本文就简单介绍一下Siege 。Siege是Linux/Unix下的一个WEB系统的压...

  • 压力测试工具siege

    一、下载并安装官方下载地址:http://download.joedog.org/siege/安装和验证: 注意:...

  • siege压力测试工具

    Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进...

  • 2019-01-07 压力测试工具

    siege 第一次压力测试

  • Siege安装

    官方网站:http://www.joedog.org/ 简介 Siege是一款高性能的Http压力测试工具。Sie...

网友评论

      本文标题:压力测试工具siege

      本文链接:https://www.haomeiwen.com/subject/xapfbctx.html