httperf命令选项

Nik*_*war 5 apache httperf

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

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

我浏览了httperf手册但是,我真的很困惑各种选项,如--rate, - num-call, - num-conn, - wsess

任何人都可以帮助我跟随:

如何指定持续时间以及如何配置--rate, - num-conn和--num-calls以便测试将在指定的持续时间内执行并具有指定的请求数/秒?

slm*_*slm 15

我会做这样的事情:

500请求/秒,持续60秒

httperf --hog --server www.google.com --uri "/" --num-conn 30000 --num-call 1 \
      --timeout 5 --rate 500 --port 80
Run Code Online (Sandbox Code Playgroud)

1000个请求/秒,持续60秒

httperf --hog --server www.google.com --uri "/" --num-conn 60000 --num-call 1 \
      --timeout 5 --rate 1000 --port 80
Run Code Online (Sandbox Code Playgroud)

持续60秒的1500请求/秒

httperf --hog --server www.google.com --uri "/" --num-conn 75000 --num-call 1 \
      --timeout 5 --rate 1500 --port 80
Run Code Online (Sandbox Code Playgroud)

注1:--rate指定固定速率连接/会话被创建.

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

最后一点是使用httperf最难解决的问题.时间长度是速率和连接数的函数,您没有指定它.

所以对于你的例子:

 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
Run Code Online (Sandbox Code Playgroud)

有关httperf的更多详细信息,请参见手册页.

--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.
Run Code Online (Sandbox Code Playgroud)

NUM-康恩

--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.
Run Code Online (Sandbox Code Playgroud)