siege压力测试软件,压力测试工具siege

siege压力测试软件,压力测试工具siegeDownloads siege 4 0 4 configure Downloads siege 4 0 4 make Downloads siege 4 0 4 makeinstall 注意 如果你不是 root 用户 需要 sudo Downloads siege 4 0 4 sudomakeinst Downloads siege 4 0 4 siege ver

~/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连接池中只有一个连接复用的场景

测试目标:连接复用是否会请求超时,连接的存活时间长短和局域网网络设备参数配置,它们对客户端程序的影响大小。

2d98728064a5

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 最短响应时间

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

2d98728064a5

image.png

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

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

2d98728064a5

image.png

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

2d98728064a5

image.png

这里补充下android客户端关于okhttp的连接池的默认值:

keepalive为5分钟,也即300秒。连接复用技术,如果一个连接是空闲状态,且存活期内,那么客户端将复用该http连接。

2、随机选取testUrls.txt中的网址,进行压力测试。

// -b,更准确的压力测试,而不是功能测试

siege -c 1000 -r 50 -f testUrls.txt -i -b

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/223644.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午1:44
下一篇 2026年3月17日 下午1:44


相关推荐

  • Drupal教程

    Drupal教程http://www.joetsuihk.com/4_drupal_theming_views

    2022年4月27日
    47
  • Spring AOP 实现原理

    Spring AOP 实现原理什么是AOPAOP(Aspect-OrientedProgramming,面向方面编程),可以说是OOP(Object-OrientedPrograming,面向对象编程)的补充和完善。OOP引入封装、继承和多态性等概念来建立一种对象层次结构,用以模拟公共行为的一个集合。当我们需要为分散的对象引入公共行为的时候,OOP则显得无能为力。也就是说,OOP允许你定义从上到下的关系,但并不适合定义从

    2022年7月12日
    16
  • 如何查询、修改参数状态值

    如何查询、修改参数状态值

    2022年3月5日
    41
  • JavaScript高级程序设计(读书笔记)(七)[通俗易懂]

    JavaScript高级程序设计(读书笔记)(七)[通俗易懂]本笔记汇总了作者认为“JavaScript高级程序设计”这本书的前七章知识重点,仅供参考。第七章函数表达式小结:在JavaScript编程中,函数表达式是一种非常有用的技术。使用函数表达式可以无须对函数命名,从而实现动态编程。匿名函数,也称为拉姆达函数,是一种使用JavaScript函数的强大方式。以下总结了函数表达式的特点。函数表达式不同于函数声明。

    2022年8月20日
    8
  • new URI(zk_servers_1) 路径包含下划线无法获取host的问题

    new URI(zk_servers_1) 路径包含下划线无法获取host的问题

    2021年7月1日
    86
  • Java中static作用及用法详解「建议收藏」

    Java中static作用及用法详解「建议收藏」static是静态修饰符,什么叫静态修饰符呢?大家都知道,在程序中任何变量或者代码都是在编译时由系统自动分配内存来存储的,而所谓静态就是指在编译后所分配的内存会一直存在,直到程序退出内存才会释放这个空间,也就是只要程序在运行,那么这块内存就会一直存在。这样做有什么意义呢?在Java程序里面,所有的东西都是对象,而对象的抽象就是类,对于一个类而言,如果要使用他的成员,那么普通情况下必须先实例化对象后,通过对象的引用才能够访问这些成员,但是用static修饰的成员可以通过类名加“.”进行直接访问。

    2022年7月8日
    25

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号