首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >httperf命令选项

httperf命令选项
EN

Stack Overflow用户
提问于 2013-02-25 05:34:47
回答 1查看 6.7K关注 0票数 5

我需要为apache执行3种类型的性能测试。

  1. 500次请求/秒,持续60秒
  2. 1000个请求/秒,持续60秒
  3. 1500个请求/秒,持续60秒

我看过httperf手册,但是,我真的很困惑于各种各样的选项,比如,速率,num,num-conn,-wsess。

有人能帮我做以下的事吗?

如何指定持续时间以及如何配置-速率、-num-conn和--num-调用,以便测试将在指定的持续时间内以指定的请求数/秒执行?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-13 13:16:54

我会这样做:

500次请求/秒,持续60秒

代码语言:javascript
复制
httperf --hog --server www.google.com --uri "/" --num-conn 30000 --num-call 1 \
      --timeout 5 --rate 500 --port 80

1000个请求/秒,持续60秒

代码语言:javascript
复制
httperf --hog --server www.google.com --uri "/" --num-conn 60000 --num-call 1 \
      --timeout 5 --rate 1000 --port 80

1500个请求/秒,持续60秒

代码语言:javascript
复制
httperf --hog --server www.google.com --uri "/" --num-conn 75000 --num-call 1 \
      --timeout 5 --rate 1500 --port 80

NOTE1: --rate指定要创建连接/会话的固定速率。

NOTE2: --num-conn指定要创建的连接总数。因此,如果要创建X req/秒,则需要执行X * 60秒,以便指定时间长度。

最后一点是用httperf找出的最难的东西。时间长度是速率的函数&连接的数量,您没有指定它。

因此,对于你的例子:

代码语言:javascript
复制
 500 req/sec @ 60 sec duration =  500 * 60 = 30,000 connections
1000 req/sec @ 60 sec duration = 1000 * 60 = 60,000 connections
1500 req/sec @ 60 sec duration = 1500 * 60 = 90,000 connections

有关httperf的详细信息,请参阅手册页。

代码语言:javascript
复制
--rate=X        Specifies the fixed rate at which connections or sessions are created.
                Connections are created by default, sessions if option --wsess  or  
                --wsesslog has been specified. In both cases a rate of 0 results 
                in connections or sessions being generated sequentially (a new 
                session/connection is initiated as soon as the previous one 
                completes). The default value for this option is 0.

康涅狄格

代码语言:javascript
复制
--num-conn=N    This  option is meaningful for request-oriented workloads only. It
                specifies the total number of connections to create. On each
                connection, calls are issued as specified by options --num-calls 
                and --burst-length. A test stops as soon as the N connections have
                either completed or failed. A connection is considered to have
                failed if any activity on the connection fails to make forward 
                progress for more than the time specified by the timeout options 
                --timeout and --think-time‐out. The default value for this option is 1.
票数 19
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15060762

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档