Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

httperf command options

Tags:

apache

httperf

I need to perform 3 types of performance tests for apache.

  1. 500 requests/sec for 60 seconds duration
  2. 1000 requests/sec for 60 seconds duration
  3. 1500 requests/sec for 60 seconds duration

I went through httperf manual but, I am really confused with various options like, --rate , --num-call , --num-conn , --wsess

could anyone help me for following:

How to specify duration and how to configure --rate , --num-conn and --num-calls so test will execute for specified duration and with specified number of requests/sec?

like image 917
Nikhil Rupanawar Avatar asked Feb 25 '13 05:02

Nikhil Rupanawar


1 Answers

I'd do something like this:

500 requests/sec for 60 seconds duration

httperf --hog --server www.google.com --uri "/" --num-conn 30000 --num-call 1 \
      --timeout 5 --rate 500 --port 80

1000 requests/sec for 60 seconds duration

httperf --hog --server www.google.com --uri "/" --num-conn 60000 --num-call 1 \
      --timeout 5 --rate 1000 --port 80

1500 requests/sec for 60 seconds duration

httperf --hog --server www.google.com --uri "/" --num-conn 75000 --num-call 1 \
      --timeout 5 --rate 1500 --port 80

NOTE1: The --rate specifies the fixed rate at which connections/sessions are to be created.

NOTE2: The --num-conn specifies the total number of connections to create. Therefore if you're creating X req/sec you need to do X * 60 secs, in order to specify the length of time.

This last point was the hardest thing to figure out with httperf. The length of time is a function of the rate & the number of connections, you don't specify it.

So for your example:

 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

See the man page for further details on httperf.

rate

--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.

num-conn

--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.
like image 198
slm Avatar answered Oct 09 '22 06:10

slm