📄 readme
字号:
-*-Mode: outline-*-* Building httperfThis release of httperf is using the standard GNU configurationmechanism. The following steps can be used to build it: $ mkdir build $ cd build $ SRCDIR/configure $ make $ make installIn this example, SRCDIR refers to the httperf source directory. Thelast step may have to be executed as "root".To build httperf with debug support turned on, invoke configure withoption "--enable-debug".By default, the httperf binary is installed in /usr/local/bin/httperfand the man-page is installed in /usr/local/man/man1/httperf. You canchange these defaults by passing appropriate options to the"configure" script. See "configure --help" for details.This release of httperf has preliminary SSL support. To enable it,you need to have OpenSSL (http://www.openssl.org/) already installedon your system. The configure script assumes that the OpenSSH headerfiles and libraries can be found in standard locations (e.g.,/usr/include and /usr/lib). If the files are in a different place,you need to tell the configure script where to find them. This can bedone by setting environment variables CPPFLAGS and LDFLAGS beforeinvoking "configure". For example, if the SSL header files areinstalled in /usr/local/ssl/include and the SSL libraries areinstalled in /usr/local/ssl/lib, then the environment variables shouldbe set like this: CPPFLAGS="-I/usr/local/ssl/include" LDFLAGS="-L/usr/local/ssl/lib"With these settings in place, "configure" can be invoked as usual andSSL should now be found. If SSL has been detected, the followingthree checks should be answered with "yes": checking for main in -lcrypto... yes checking for SSL_version in -lssl... yes : checking for openssl/ssl.h... yesNote: you may have to delete "config.cache" to ensure that "configure"re-evaluates those checks after changing the settings of theenvironment variables. WARNING: httperf uses a deterministic seed for the random number generator used by SSL. Thus, the SSL encrypted data is likely to be easy to crack. In other words, do not assume that SSL data transferred when using httperf is (well) encrypted!This release of httperf has been tested under HP-UX 10.20 and 11.0,various versions of Red Hat Linux, both on the x86 and IA-64architectures. It should be straight-forward to build httperf onother platforms, but your mileage may vary.* Mailing listA mailing list has been set up to encourage discussions among thehttperf user community. This list is managed by majordomo. Tosubscribe to the list, send a mail containing the body: subscribe httperfto majordomo@linux.hpl.hp.com. To post an article to the list, sendit directly to httperf@linux.hpl.hp.com.* Running httperfIMPORTANT: It is crucial to run just one copy of httperf per clientmachine. httperf sucks up all available CPU time on a machine. It istherefore important not to run any other (CPU-intensive) tasks on aclient machine while httperf is running. httperf is a CPU hog toensure that it can generate the desired workload with good accuracy,so do not try to change this without fully understanding what theissues are.** ExamplesThe simplest way to invoke httperf is with a command line of the form: httperf --server wailua --port 6800This command results in httperf attempting to make one request for URLhttp://wailua:6800/. After the reply is received, performancestatistics will be printed and the client exits (the statistics areexplained below).A list of all available options can be obtained by specifying the--help option (all option names can be abbreviated as long as theyremain unambiguous).A more realistic test case might be to issue 1000 HTTP requests at arate of 10 requests per second. This can be achieved by additionallyspecifying the --num-conns and --rate options. When specifying the--rate option, it's generally a good idea to also specify a timeoutvalue using the --timeout option. In the example below, a timeout ofone second is specified (the ramification of this option will beexplained later): httperf --server wailua --port 6800 --num-conns 100 --rate 10 --timeout 1The performance statistics printed by httperf at the end of the testmight look like this: Total: connections 100 requests 100 replies 100 test-duration 9.905 s Connection rate: 10.1 conn/s (99.1 ms/conn, <=1 concurrent connections) Connection time [ms]: min 4.6 avg 5.6 max 19.9 median 4.5 stddev 2.0 Connection time [ms]: connect 1.4 Connection length [replies/conn]: 1.000 Request rate: 10.1 req/s (99.1 ms/req) Request size [B]: 57.0 Reply rate [replies/s]: min 10.0 avg 10.0 max 10.0 stddev 0.0 (1 samples) Reply time [ms]: response 4.1 transfer 0.0 Reply size [B]: header 219.0 content 204.0 footer 0.0 (total 423.0) Reply status: 1xx=0 2xx=100 3xx=0 4xx=0 5xx=0 CPU time [s]: user 2.71 system 7.08 (user 27.4% system 71.5% total 98.8%) Net I/O: 4.7 KB/s (0.0*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0There are six groups of statistics: overall results ("Total"),connection related results ("Connection"), results relating to theissuing of HTTP requests ("Request"), results relating to the repliesreceived from the server ("Reply"), miscellaneous results relating tothe CPU time and network bandwidth used, and, finally, a summary oferrors encountered ("Errors"). Let's discuss each in turn:** "Total" ResultsThe "Total" line summarizes how many TCP connections were initiated bythe client, how many requests it sent, how many replies it received,and what the total test duration was. The line below shows that 100connections were initiated, 100 requests were performed and 100replies were received. It also shows that total test-duration was9.905 seconds meaning that the average request rate was almost exactly10 request per second. Total: connections 100 requests 100 replies 100 test-duration 9.905 s** "Connection" ResultsThese results convey information related to the TCP connections thatare used to communicate with the web server.Specifically, the line below show that new connections were initiatedat a rate of 10.1 connections per second. This rate corresponds to aperiod of 99.1 milliseconds per connection. Finally, the last numbershows that at most one connection was open to the server at any giventime. Connection rate: 10.1 conn/s (99.1 ms/conn, <=1 concurrent connections)The next line in the output gives lifetime statistics for successfulconnections. The lifetime of a connection is the time between a TCPconnection was initiated and the time the connection was closed. Aconnection is considered successful if it had at least one requestthat resulted in a reply from the server. The line shown belowindicates that the minimum ("min") connection lifetime was 4.6milliseconds, the average ("avg") lifetime was 5.6 milliseconds, themaximum ("max") was 19.9 milliseconds, the median ("median") lifetimewas 4.5 milliseconds, and that the standard deviation of the lifetimeswas 2.0 milliseconds. Connection time [ms]: min 4.6 avg 5.6 max 19.9 median 4.5 stddev 2.0To compute the median time, httperf collects a histogram of connectionlifetimes. The granularity of this histogram is currently 1milliseconds and the maximum connection lifetime that can beaccommodated with the histogram is 100 seconds (these numbers can bechanged by editing macros BIN_WIDTH and MAX_LIFETIME in stat/basic.c).This implies that the granularity of the median time is 1 millisecondand that at least 50% of the lifetime samples must have a lifetime ofless than 100 seconds.The next statistic in this section is the average time it took toestablish a TCP connection to the server (all successful TCPconnections establishments are counted, even connections that may havefailed eventually). The line below shows that, on average, it took1.4 milliseconds to establish a connection. Connection time [ms]: connect 1.4The final line in this section gives the average number of repliesthat were received per connection. With regular HTTP/1.0, this valueis at most 1.0 (when there are no failures), but with HTTP Keep-Alivesor HTTP/1.1 persistent connections, this value can be arbitrarilyhigh, indicating that the same connection was used to receive multipleresponses.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -