📄 httperf.man
字号:
Thus, if the URI-prefix is.BR /wset1024 ,then the URI being accessed would be.BR /wset1024/0/1/0/3.html .In other words, the files on the server need to be organized as a10ary tree..SH OUTPUTThis section describes the statistics output at the end of each testrun. The basic information shown below is printed independent of theselected workload generator..PP.RS.br.B Total:connections 30000 requests 29997 replies 29997 test-duration 299.992 s.PP.B Connection rate:100.0 conn/s (10.0 ms/conn, <=14 concurrent connections).br.B Connection time [ms]:min 1.4 avg 3.0 max 163.4 median 1.5 stddev 7.3.br.B Connection time [ms]:connect 0.6.br.B Connection length [replies/conn]:1.000.PP.B Request rate:100.0 req/s (10.0 ms/req).br.B Request size [B]:75.0.PP.B Reply rate [replies/s]:min 98.8 avg 100.0 max 101.2 stddev 0.3 (60 samples).br.B Reply time [ms]:response 2.4 transfer 0.0.br.B Reply size [B]:header 242.0 content 1010.0 footer 0.0 (total 1252.0).br.B Reply status:1xx=0 2xx=29997 3xx=0 4xx=0 5xx=0.PP.B CPU time [s]:user 94.31 system 205.26 (user 31.4% system 68.4% total 99.9%).br.B Net I/O:129.6 KB/s (1.1*10^6 bps).PP.B Errors:total 3 client-timo 0 socket-timo 0 connrefused 3 connreset 0.br.B Errors:fd-unavail 0 addrunavail 0 ftab-full 0 other 0.br.RE.PPThere 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 (``CPU'') and network (``Net I/O'') utilization and, last but notleast, a summary of errors encountered (``Errors'')..TPTotal Section.brThis section summarizes how many TCP connections were initiated by.BR httperf ,how many requests it sent out, how many replies it received, andwhat the total test duration was. In the example outputshown above, 30,000 connections were created, 29,997 requests weresent out and 29,997 replies were received. The duration of thetest was almost exactly 5 minutes (300 seconds)..TPConnection Section.brThis section conveys information related to TCP connections generatedby the tool. Specifically, the ``Connection rate'' line shows that newconnections were initiated at a rate of 100.0 connections per second.This rate corresponds to a period of 10.0 milliseconds perconnection. The last number in this line shows that at most 14connections were open at any given time.The first line labeled ``Connection time'' gives lifetime statisticsfor successful connections. The lifetime of a connection is the timebetween a TCP connection is initiated and the time the connection isclosed. A connection is considered successful if it had at least onecall that completed successfully. In the example output, the lineindicates that the minimum (``min'') connection lifetime was 1.4milliseconds, the average (``avg'') lifetime was 3.0 milliseconds, themaximum (``max'') was 163.4 milliseconds, the median (``median'')lifetime was 1.5 milliseconds, and that the standard deviation of thelifetimes was 7.3 milliseconds. The median lifetime is computed basedon a histogram with one millisecond resolution and a maximum lifetimeof 100 seconds. Thus, the median is accurate to within half amillisecond if at least half of the successful connections have alifetime of no more than 100 seconds.The next statistic in this section is the average time it took toestablish a TCP connection. Only successful TCP connectionestablishments are counted. In the example, the second line labeled``Connection time'' shows that, on average, it took 0.6 millisecondsto establish a connection.The final line in this section is labeled ``Connection length.'' Itgives the average number of replies received on each connection thatreceived at least one reply (i.e., connections that failed beforeyielding the first reply are not counted). This number can be biggerthan 1.0 due to persistent connections..TPRequest Section.brThe line labeled ``Request rate'' gives the rate at which HTTP requestswere issued and the period that this rate corresponds to. In theexample above, the request rate was 100.0 requests per second, whichcorresponds to 10.0 milliseconds per request. As long as nopersistent connections are employed, the results in this section arevery similar or identical to results in the connection section.However, when persistent connections are used, several calls can beperformed on a single connection in which case the results would bedifferent.The line labeled ``Request size'' gives the average size of the HTTPrequests in bytes. In the example above, the average request size was75 bytes..TPReply Section.brFor simple measurements, this section is often the most interestingone as the line labeled ``Reply rate'' gives various statistics forthe reply rate. In the example above, the minimum (``min'') replyrate was 98.8 replies per second, the average (``avg'') was 100replies per second, and the maximum (``max'') rate was 101.2 repliesper second. The standard deviation was 0.3 replies per second. Thenumber enclosed in parentheses shows that 60 reply rate samples wereacquired. At present,.B httperfcollects a rate sample once every five seconds. To obtain ameaningful standard deviation, it is recommended to run tests longenough so at least thirty samples are obtained. This corresponds to atest duration of at least 150 seconds.The line labeled ``Reply Time'' gives information on how long it tookfor the server to respond and how long it took to receive the reply.In the example, it took on average 2.4 milliseconds between sendingthe first byte of the request and receiving the first byte of thereply. The time to ``transfer'', or read, the reply was too short tobe measured, so it shows up as zero. The is typical when the entirereply fits into a single TCP segment.The next line, labeled ``Reply size'' contains statistics on theaverage size of the replies---all numbers are in reported bytes.Specifically, the line lists the average length of reply headers, thecontent, and footers (HTTP/1.1 uses footers to realize the ``chunked''transfer encoding). For convenience, the average total number ofbytes in the replies is also given in parentheses. In the example,the average header length (``header'') was 242 bytes, the averagecontent length (``content'') was 1010 bytes, and there were no footers(``footer'' length is zero). The total reply length of 1252 bytes onaverage.The final line in this section is a histogram of the major statuscodes received in the replies from the server. The major status codeis the ``hundreds''-digit of the full HTTP status code. In theexample, all 29,997 replies had a major status code of 2. It's a goodguess that all status codes were ``200 OK'' but the information in thehistogram is not detailed enough to allow distinguishing status codeswith the same major code..TPMiscellaneous Section.brThis section starts with a summary of the CPU utilization on theclient machine. In the example, the line labeled ``CPU time'' showsthat 94.31 seconds were spent executing in user mode (``user''),205.26 seconds were spent executing in system mode (``system'') andthat this corresponds to 31.4% user mode execution and 68.4% systemexecution. The total utilization was 99.9%, which is expected giventhat.B httperfis a CPU hog. A total CPU utilization of significantly less than 100%is a sign that there were competing processes that interfered with thetest.The line labeled ``Net I/O'' gives the average network throughput inkilobytes per second (where a kilobyte is 1024 bytes) and in megabitsper second (where a megabit is 10^6 bits). In the example, an averagenetwork usage of about 129.6 kilobytes per second was sustained. Thenumber in parentheses shows that this corresponds to about 1.1megabits per second. This network bandwidth is computed based on thenumber of bytes sent and received on the TCP connections. In otherwords, it does not account for the network headers or TCPretransmissions that may have occurred..TPErrors Section.brThe last section contains statistics on the errors that wereencountered during a test. In the example, the two lines labeled``Errors'' show that there were a total of three errors and that allthree errors were due to the server refusing to accept a connection(``connrefused''). A description of each error counter follows:.B client-timo:The number of times a session, connection, or call failed dueto a client timeout (as specified by the.B --timeoutand.BR --think-timeout )options..B socket-timo:The number of times a TCP connection failed with a socket-leveltimeout (ETIMEDOUT)..B connrefused:The number of times a TCP connection attempt failed with a``connection refused by server'' error (ECONNREFUSED)..B connreset:The number of times a TCP connection failed due to a RESET from theserver. Typically, a RESET is received when the client attempts tosend data to the server at a time the server has already closed itsend of the connection. NT servers also send RESETs when attempting toestablish a new connection when the listen queue is full..B fd-unavail:The number of times the.B httperfprocess was out of file descriptors. Whenever this count is non-zero,the test results are meaningless because the client was overloaded(see section "CHOOSING TIMEOUT VALUES")..B addrunavail:The number of times the client was out of TCP port numbers(EADDRNOTAVAIL). This error should never occur. If it does, theresults should be discarded..B ftab-full:The number of times the system's file descriptor table is full.Again, this error should never occur. If it does, the results shouldbe discarded..B other:The number of times some other type of error occurred. Whenever thiscounter is non-zero, it is necessary to track down the real cause ofthe error. To assist in doing this,.B httperfprints the error code (errno) of the first unknown errors that occursduring a test run..RE.PPWhen.B --wsessor.B --wsesslogis specified,.B httperfgenerates and measures sessions instead of individual calls andadditional statistics are printed at the end of a test. An exampleoutput is shown below..PP.RS.B Session rate [sess/s]:min 0.00 avg 0.59 max 2.40 stddev 0.37 (240/450).br.B Session:avg 6.45 connections/session.br.B Session lifetime [s]:123.9.br.B Session failtime [s]:58.5.br.B Session length histogram:4 7 4 ... 3 3 240.RE.PPThe line labeled ``Session rate'' shows the minium, average, andmaximum rate at which sessions completed (based on a 5 second samplinginterval). It also shows the standard deviation of the sessioncompletion rate. The numbers in parentheses show how many sessionssucceeded and how many sessions were initiated. In the example above,the minimum, average, and maximum session completion rates were 0.00,0.59, and 2.40 sessions per second, respectively. The standarddeviation was 0.37 sessions per second and 240 out of 450 sessionscompleted successfully (210 failed due to errors such as timeouts).The next line, labeled ``Session:'' shows the average length of asession measured in connections. In the example above, an average of6.45 connections were required to complete a session.The line labeled ``Session lifetime'' gives the average time it tookto complete a successful session. In the example above, it took anaverage of 123.9 seconds.The line labeled ``Session failtime'' gives the average time it tookbefore an unsuccessful session failed. In the example above, it tookon average 58.5 seconds for a session to fail.Finally, the line labeled ``Session length histogram'' gives ahistogram of the number of replies received by each session. In theexample above, 4 sessions ended after receiving no reply at all, 7ended after receiving one reply, and so on (the ellipsis indicatesadditional histogram counts that were omitted from this manual forspace reasons). Note that this histogram does not distinguish betweensuccessful and failed sessions..SH CHOOSING TIMEOUT VALUESSince the machine that.B httperfruns on has only a finite set of resource available, it can notsustain arbitrarily high HTTP loads. For example, one limiting factoris that there are only roughly 60,000 TCP port numbers that can be inuse at any given time. Since on most UNIX systems it takes one minutefor a TCP connection to be fully closed (leave the TIME_WAIT state),the maximum rate a client can sustain is at most 1,000 requests persecond.The actual sustainable rate is often much lower than that becausebefore running out of TCP ports, the machine is likely to run out offile descriptors (one file descriptor is used up for each open TCPconnection). By default, HP-UX 10.20 allows 1,024 open filedescriptors per process. This means that without extra precautions,.B httperfcould potentially very quickly use up all available file descriptors,at which point it could not induce any additional load on the server.To avoid this problem,.B httperfprovides option.B --timeoutto set a timeout for all communication with the server. If the serverdoes not respond before the timeout expires, the client considers thecorresponding session, connection, or call to be ``dead,'' closes theassociated TCP connection, and increases the ``client-timo'' errorcount. The only exception to this rule is that after sending anentire request to the server,.B httperfallows the server to take some additional time before it startssending the reply. This is to accommodate HTTP requests that take along time to complete on the server. This additional time is calledthe ``server think time'' and can be specified by option.BR --think-timeout .By default, this additional think time is zero seconds, so the serverwould always have to respond within the time alloted by option.BR --timeout .Timeouts allow.B httperf to sustain high offered loads even when the server is overloaded. Forexample, with a timeout of 2 seconds and assuming that 1,000file-descriptors are available, the offered load could be up to 500requests per second (in practice, the sustainable load is oftensomewhat smaller than the theoretical value). On the downside,timeouts artificially truncate the connection lifetime distribution.Thus, it is recommended to pick a timeout value that is as large aspossible yet small enough to allow sustaining the desired offeredrate. A timeout as short as one second may be acceptable, but largertimeouts (5-10 seconds) are preferable.It is important to keep in mind that timeouts do not guarantee that aclient can sustain a particular offered load---there are many otherpotential resource bottlenecks. For example, in some cases the clientmachine may simply run out of CPU time. To ensure that a given testreally measured the server's capabilities and not the client's, it isa good idea to vary the number of machines participating in a test.If observed performance remains the same as the number of clientmachines is varied, the test results are likely to be valid..SH AUTHOR.BR httperfwas developed by David Mosberger and was heavily influenced by anearlier tool written by Tai Jin. Stephane Eranian contributed thelog-file based URI generator. Dick Carter contributed the.B --wsesslogworkload generator, the support behind the.B --periodoption, and bug fixes. All four authors are with Hewlett-PackardResearch Laboratories..SH BUGSProbably many. Always be sure to double-check results and don't fallprey to measuring client-performance instead of server performance!.PPThe user-interface definitely could be improved. A simple workloaddescription language might be more suitable than the dozens of littlecommand-line options the tool has right now.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -