The httperf - HTTP load generator with post-quantum support from BoringSSL
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

1186 wiersze
41 KiB

  1. .\" .IX httperf
  2. .TH "httperf" "1" "01 Feb 2008" "" ""
  3. .SH "NAME"
  4. httperf \- HTTP performance measurement tool
  5. .SH "SYNOPSIS"
  6. .B httperf
  7. .RB [ \-\-add\-header
  8. .I R S ]
  9. .RB [ \-\-burst\-length
  10. .I R N ]
  11. .RB [ \-\-client
  12. .I R I / N ]
  13. .RB [ \-\-close\-with\-reset ]
  14. .RB [ \-d | \-\-debug
  15. .I R N ]
  16. .RB [ \-\-failure\-status
  17. .I R N ]
  18. .RB [ \-h | \-\-help ]
  19. .RB [ \-\-hog ]
  20. .RB [ \-\-http\-version
  21. .I R S ]
  22. .RB [ \-\-max\-connections
  23. .I R N ]
  24. .RB [ \-\-max\-piped\-calls
  25. .I R N ]
  26. .RB [ \-\-method
  27. .I R S ]
  28. .RB [ \-\-no\-host\-hdr ]
  29. .RB [ \-\-num\-calls
  30. .I R N ]
  31. .RB [ \-\-num\-conns
  32. .I R N ]
  33. .RB [ \-\-period " [" d | u | e ] \fIT1\fR [ ,\fIT2\fR ]]
  34. .RB [ \-\-port
  35. .I R N ]
  36. .RB [ \-\-print\-reply " [" header | body ] ]
  37. .RB [ \-\-print\-request " [" header | body ] ]
  38. .RB [ \-\-rate
  39. .I R X ]
  40. .RB [ \-\-recv\-buffer
  41. .I R N ]
  42. .RB [ \-\-retry\-on\-failure ]
  43. .RB [ \-\-send\-buffer
  44. .I R N ]
  45. .RB [ \-\-server
  46. .I R S ]
  47. .RB [ \-\-server\-name
  48. .I R S ]
  49. .RB [ \-\-session\-cookie ]
  50. .RB [ \-\-ssl ]
  51. .RB [ \-\-ssl\-ciphers
  52. .I R L ]
  53. .RB [ \-\-ssl\-no\-reuse ]
  54. .RB [ \-\-think\-timeout
  55. .I R X ]
  56. .RB [ \-\-timeout
  57. .I R X ]
  58. .RB [ \-\-uri
  59. .I R S ]
  60. .RB [ \-v | \-\-verbose ]
  61. .RB [ \-V | \-\-version ]
  62. .RB [ "\-\-wlog y" | n, \fIF\fR]
  63. .RB [ \-\-wsess
  64. .I R N , N , X ]
  65. .RB [ \-\-wsesslog
  66. .I R N , X , F ]
  67. .RB [ \-\-wset
  68. .I R N , X ]
  69. .SH "DESCRIPTION"
  70. .B httperf
  71. is a tool to measure web server performance. It speaks the HTTP
  72. protocol both in its HTTP/1.0 and HTTP/1.1 flavors and offers a
  73. variety of workload generators. While running, it keeps track of a
  74. number of performance metrics that are summarized in the form of
  75. statistics that are printed at the end of a test run. The most basic
  76. operation of
  77. .B httperf
  78. is to generate a fixed number of HTTP GET requests and to measure how
  79. many replies (responses) came back from the server and at what rate
  80. the responses arrived.
  81. .B IMPORTANT:
  82. To obtain correct results, it is necessary to run at most one
  83. .B httperf
  84. process per client machine. Also, there should be as few background
  85. processes as possible both on the client and server machines.
  86. .SH "EXAMPLES"
  87. .TP
  88. httperf \-\-hog \-\-server www
  89. This command causes
  90. .B httperf
  91. to create a connection to host www, send a request for the root
  92. document (http://www/), receive the reply, close the connection, and
  93. then print some performance statistics.
  94. .TP
  95. httperf \-\-hog \-\-server www \-\-num\-conn 100 \-\-ra 10 \-\-timeout 5
  96. Like above, except that a total of 100 connections are created and
  97. that connections are created at a fixed rate of 10 per second. Note
  98. that option ``\-\-rate'' has been abbreviated to ``\-\-ra''.
  99. .TP
  100. httperf \-\-hog \-\-server=www \-\-wsess=10,5,2 \-\-rate 1 \-\-timeout 5
  101. Causes
  102. .B httperf
  103. to generate a total of 10 sessions at a rate of 1 session per second.
  104. Each session consists of 5 calls that are spaced out by 2 seconds.
  105. .TP
  106. httperf \-\-hog \-\-server=www \-\-wsess=10,5,2 \-\-rate=1 \-\-timeout=5 \-\-ssl
  107. Like above, except that
  108. .B httperf
  109. contacts server www via SSL at port 443 (the default port for SSL
  110. connections).
  111. .TP
  112. httperf \-\-hog \-\-server www \-\-wsess=10,5,2 \-\-rate=1 \-\-timeout=5 \-\-ssl \-\-ssl\-ciphers=EXP\-RC4\-MD5:EXP\-RC2\-CBC\-MD5 \-\-ssl\-no\-reuse \-\-http\-version=1.0
  113. Like above, except that
  114. .B httperf
  115. will inform the server that it can only select from two cipher suites
  116. (EXP\-RC4\-MD5 or EXP\-RC2\-CBC\-MD5); furthermore,
  117. .B httperf
  118. will use HTTP version 1.0 which requires a new TCP connection for each
  119. request. Also, SSL session ids are not reused, so the entire SSL
  120. connection establishment process (known as the SSL handshake) occurs
  121. for each connection.
  122. .SH "OPTIONS"
  123. The operation of
  124. .B httperf
  125. can be controlled through a number of options. The tool supports both
  126. short (one\-character) and long (arbitrary\-length) option names. Short
  127. options are prefixed with a single leading dash (\-), long
  128. options with a double\-dash (\-\-). Multiple short options can be
  129. grouped together (e.g.,
  130. .RB `` \-vV ''
  131. is equivalent to
  132. .RB `` "\-v \-V" '')
  133. and long options can be abbreviated so long as they remain unique.
  134. Parameters to options can be specified either by following the long
  135. option name with an equal sign and the parameter value (e.g.,
  136. .BR \-\-burst=10 )
  137. or by separating the option name and value with whitespace (e.g.,
  138. .BR "\-\-burst 10" ).
  139. .TP
  140. .BI \-\-add\-header= S
  141. Specifies to include string
  142. .I S
  143. as an additional request header. It is necessary to specify the
  144. terminating carriage\-return/line\-feed sequence explicitly. This can
  145. be done by using the escape sequence ``\\n''. This makes it possible
  146. to include multiple request headers. For example, ``\-\-add\-header
  147. "Referer: foo\\nAuth: secret\\n"'' would add two request headers
  148. (``Referer'' and ``Auth'') to each request. Other supported escape
  149. sequences are ``\\r'' (carriage\-return), ``\\a'' (line\-feed), ``\\\\''
  150. (backslash), and ``\\N'' where N is the code the character to be
  151. inserted (in octal).
  152. .TP
  153. .BI \-\-burst\-length= N
  154. Specifies the length of bursts. Each burst consists of
  155. .I N
  156. calls to the server. The exact meaning of this parameter depends on
  157. the workload generator. For regular request\-oriented workloads, see the
  158. description of option
  159. .BR \-\-wsess .
  160. .TP
  161. .BR \-\-no\-host\-hdr
  162. Specifies that the "Host:" header should not be included when issuing
  163. an HTTP request.
  164. .TP
  165. .BR \-\-num\-calls .
  166. For session\-oriented workloads, see the description of option
  167. .BR \-\-wsess .
  168. .TP
  169. .BI \-\-client= I / N
  170. Specifies that the machine
  171. .B httperf
  172. is running on is client
  173. .I I
  174. out of a total of
  175. .I N
  176. clients.
  177. .I I
  178. should be in the range from 0 to
  179. .I R N "\-1."
  180. Some of the workload generators (e.g.,
  181. .BR \-\-wset)
  182. use the client identity as a bias value to ensure that not all clients
  183. generate perfectly identical workloads. When performing a test that
  184. involves several client machines, it is generally a good idea to
  185. specify this option.
  186. .TP
  187. .BI \-\-close\-with\-reset
  188. Requests that
  189. .B httperf
  190. closes TCP connections by sending a RESET instead of going through the
  191. normal TCP connection shutdown handshake. Turning on this option can
  192. have ill effects such as data corruption, stuck TCP control blocks, or
  193. wrong results. For this reason, the option should not be used unless
  194. absolutely necessary and even then it should not be used unless its
  195. implications are fully understood.
  196. .TP
  197. .BI \-d= N
  198. .TP
  199. .BI \-\-debug= N
  200. Set debug level to
  201. .I R N .
  202. Larger values of
  203. .I N
  204. will result in more output.
  205. .TP
  206. .BI \-\-failure\-status= N
  207. Specifies that an HTTP response status code of
  208. .I N
  209. should be treated as a failure (i.e., treated as if the request had
  210. timed out, for example). For example, with
  211. .RB `` \-\-failure\-status=504 ''
  212. responses with an HTTP status of ``504 Gateway Time\-out'' would be
  213. considered failures. Caveat: this option is currently supported
  214. for session workloads only (see the
  215. .B \-\-wsess
  216. and
  217. .B \-\-wsesslog
  218. options).
  219. .TP
  220. .B \-h
  221. .TP
  222. .B \-\-help
  223. Prints a summary of available options and their parameters.
  224. .TP
  225. .BI \-\-hog
  226. This option requests to use up as many TCP ports as necessary.
  227. Without this option,
  228. .B httperf
  229. is typically limited to using ephemeral ports (in the range from 1024
  230. to 5000). This limited port range can quickly become a bottleneck so
  231. it is generally a good idea to specify this option for serious
  232. testing. Also, this option must be specified when measuring NT
  233. servers since it avoids a TCP incompatibility between NT and UNIX
  234. machines.
  235. .TP
  236. .BI \-\-http\-version= S
  237. Specifies the version string that should be included in the requests
  238. sent to the server. By default, version string ``1.1'' is used. This
  239. option can be set to ``1.0'' to force the generation of HTTP/1.0
  240. requests. Setting this option to any value other than ``1.0'' or ``1.1''
  241. may result in undefined behavior.
  242. .TP
  243. .BI \-\-max\-connections= N
  244. Specifies that at most
  245. .I N
  246. connections are opened for each session. This option is meaningful in
  247. conjunction with options
  248. .B \-\-wsess
  249. and
  250. .B \-\-wsesslog
  251. only.
  252. .TP
  253. .BI \-\-max\-piped\-calls= N
  254. Specifies that at most
  255. .I N
  256. pipelined calls are issued on each connection. This option is
  257. meaningful in conjunction with options
  258. .B \-\-wsess
  259. and
  260. .B \-\-wsesslog
  261. only.
  262. .TP
  263. .BI \-\-method= S
  264. Specifies the method that should be used when issuing an HTTP request.
  265. If this option is not specified, the GET method is used. The method
  266. .I S
  267. can be an arbitrary string but is usually one of GET, HEAD, PUT, POST,
  268. etc.
  269. .TP
  270. .BI \-\-num\-calls= N
  271. This option is meaningful for request\-oriented workloads only. It
  272. specifies the total number of calls to issue on each connection before
  273. closing it. If
  274. .I N
  275. is greater than 1, the server must support persistent connections.
  276. The default value for this option is 1. If
  277. .BR \-\-burst\-length
  278. is set to
  279. .I R B ,
  280. then the
  281. .I N
  282. calls are issued in bursts of
  283. .I B
  284. pipelined calls each. Thus, the total number of such bursts will
  285. be
  286. .I N/B
  287. (per connection).
  288. .TP
  289. .BI \-\-num\-conns= N
  290. This option is meaningful for request\-oriented workloads only. It
  291. specifies the total number of connections to create. On each
  292. connection, calls are issued as specified by options
  293. .B \-\-num\-calls
  294. and
  295. .BR \-\-burst\-length .
  296. A test stops as soon as the
  297. .I N
  298. connections have either completed or failed. A connection is
  299. considered to have failed if any activity on the connection fails to
  300. make forward progress for more than the time specified by the timeout
  301. options
  302. .B \-\-timeout
  303. and
  304. .BR \-\-think\-timeout .
  305. The default value for this option is 1.
  306. .TP
  307. .BI \-\-period= [D]T1[,T2]
  308. Specifies the time interval between the creation of connections or sessions.
  309. Connections are created by default, sessions if option
  310. .B \-\-wsess
  311. or
  312. .B \-\-wsesslog
  313. has been specified.
  314. This connection/session ``interarrival time'' can alternatively be specified by
  315. the
  316. .B \-\-rate
  317. option, although more flexibility is available with
  318. .B \-\-period.
  319. The
  320. .I D
  321. parameter specifies the interarrival time distribution.
  322. If omitted or set to
  323. .RB `` d '',
  324. a deterministic (i.e., fixed) period is used as specified
  325. by parameter
  326. .I R T1
  327. in units of seconds.
  328. If
  329. .I D
  330. is set to
  331. .RB `` e '',
  332. an exponential (i.e., Poisson) distribution is used with
  333. a mean interarrival time of
  334. .I R T1 .
  335. If
  336. .I D
  337. is set to
  338. .RB `` u '',
  339. a uniform distribution over the interval
  340. .RI [ T1 , T2 )
  341. is used for the interarrival time.
  342. Finally, if
  343. .I D
  344. is set to
  345. .RB ``v'',
  346. a number of rates can be specified as follows:
  347. .B \-\-period=vT1,D1,T2,D2...Tn,Dn
  348. Where n <= NUM_RATES in httperf.h and
  349. .I Ti,Di
  350. represent the period time (i.e., 1/rate) and duration to
  351. maintain that rate (i.e.,
  352. .B \-\-period=v1,2,0.5,4
  353. will generate 1 request/seconds for 2 seconds then
  354. 2 requests/seconds for 4 seconds).
  355. In all cases, a period of 0 results in connections
  356. or sessions being generated sequentially (a new connection/session is
  357. initiated as soon as the previous one completes). The default value
  358. for this option is 0. Note that specifying, for example,
  359. .B \-\-rate=5
  360. is equivalent to specifying
  361. .B \-\-period=d0.2
  362. or
  363. .BR \-\-period=0.2 .
  364. By specifying
  365. .BR \-\-period=u1,3 ,
  366. the interarrival times will be randomly chosen from the interval
  367. between 1 and 3 seconds. The specific sequence of (pseudo\-)random
  368. interarrival times are identical from one
  369. .B httperf
  370. run to another as long as the values for the
  371. .B \-\-period
  372. and
  373. .B \-\-client
  374. options are identical.
  375. .TP
  376. .BI \-\-port= N
  377. This option specifies the port number
  378. .I N
  379. on which the web server is listening for HTTP requests. By default,
  380. .B httperf
  381. uses port number 80.
  382. .TP
  383. .BR \-\-print\-reply [ = [ header | body ]]
  384. Requests the printing of the reply headers, body, and summary. The
  385. output is directed to standard output. Reply header lines are
  386. prefixed by "RH", reply body lines are prefixed by "RB", and the
  387. reply\-size summary is prefixed by "RS". The prefix is followed by a
  388. serial number that uniquely identifies the call that the reply line is
  389. for and a colon (":") character that marks the beginning of the actual
  390. reply line. To print only reply headers, pass argument
  391. .B header
  392. to this option. To print only the reply body, pass argument
  393. .B body
  394. to this option.
  395. .TP
  396. .BR \-\-print\-request [ = [ header | body ]]
  397. Requests the printing of the request headers, body (if one is
  398. present), and summary. The output is directed to standard output.
  399. Request header lines are prefixed by "SH", request body lines are
  400. prefixed by "SB", and the request summary is prefixed by "SS". The
  401. prefix is followed by the call's serial number and a colon (":")
  402. character that marks the beginning of the actual reply line. To print
  403. only request headers, pass argument
  404. .B header
  405. to this option. To print only the request body, pass argument
  406. .B body
  407. to this option.
  408. .TP
  409. .BI \-\-rate= X
  410. Specifies the fixed rate at which connections or sessions are created.
  411. Connections are created by default, sessions if option
  412. .B \-\-wsess
  413. or
  414. .B \-\-wsesslog
  415. has been specified. In both cases a rate of 0 results in connections
  416. or sessions being generated sequentially (a new session/connection is
  417. initiated as soon as the previous one completes). The default value
  418. for this option is 0.
  419. .TP
  420. .BI \-\-recv\-buffer= N
  421. Specifies the maximum size of the socket receive buffers used to
  422. receive HTTP replies. By default, the limit is 16KB. A smaller value
  423. may help memory\-constrained clients whereas a larger value may be
  424. necessary when communicating with a server over a high\-bandwidth,
  425. high\-latency connection.
  426. .TP
  427. .BI \-\-retry\-on\-failure
  428. This option is meaningful for session workloads only (see the
  429. .B \-\-wsess
  430. and
  431. .B \-\-wsesslog
  432. options). If specified, a call that results in a failure response (as
  433. defined by the
  434. .B \-\-failure\-status
  435. option) is retried immediately instead of causing the session to fail.
  436. .TP
  437. .BI \-\-send\-buffer= N
  438. Specifies the maximum size of the socket send buffers used to send
  439. HTTP requests. By default, the limit is 4KB. A smaller value may
  440. help memory\-constrained clients whereas a larger value may be
  441. necessary when generating large requests to a server connected via a
  442. high\-bandwidth, high\-latency connection.
  443. .TP
  444. .BI \-\-server= S
  445. Specifies the IP hostname of the server. By default, the hostname
  446. ``localhost'' is used. This option should always be specified as it
  447. is generally not a good idea to run the client and the server on the
  448. same machine.
  449. .TP
  450. .BI \-\-server\-name= S
  451. Specifies the (default) server name that appears in the "Host:" header
  452. of every request sent by
  453. .BR httperf .
  454. Without this option, the host name (or IP address) specified by option
  455. .B \-\-server
  456. is used instead.
  457. .TP
  458. .B \-\-session\-cookie
  459. When this option is turned on, cookie managment is enabled on a
  460. per\-session basis. What this means is that if a reply to a request
  461. that was generated by session
  462. .I R X
  463. contains a cookie, then all future requests sent by session
  464. .I X
  465. will include this cookie as well. At present, the cookie manager in
  466. .B httperf
  467. supports only one cookie per session. If a second cookie is received,
  468. the new cookie overwrites the existing one and a warning message is
  469. printed if ``\-\-debug 1'' is on.
  470. .TP
  471. .B \-\-ssl
  472. Specifies that all communication between
  473. .B httperf
  474. and the server should utilize the Secure Sockets Layer (SSL) protocol.
  475. This option is available only if
  476. .B httperf
  477. was compiled with SSL support enabled.
  478. .TP
  479. .BI \-\-ssl\-ciphers= L
  480. This option is only meaningful if SSL is in use (see
  481. .B \-\-ssl
  482. option). This option specifies the list
  483. .I L
  484. of cipher suites that
  485. .B httperf
  486. may use in negotiating a secure connection with the server. If the
  487. list contains more than one cipher suite, the ciphers must be
  488. separated by a colon. If the server does not accept any of the listed
  489. cipher suites, the connection establishment will fail and
  490. .B httperf
  491. will exit immediately. If this option is not specified when the
  492. .B \-\-ssl
  493. option is present then
  494. .B httperf
  495. will use all of the SSLv3 cipher suites provided by the underlying SSL
  496. library.
  497. .TP
  498. .B \-\-ssl\-no\-reuse
  499. This option is only meaningful if SSL and sessions are in use (see
  500. .BR \-\-ssl ,
  501. .BR \-\-wsess ,
  502. .BR \-\-wsesslog ).
  503. When an SSL connection is established the client receives a session
  504. identifier (session id) from the server. On subsequent SSL
  505. connections, the client normally reuses this session id in order to
  506. avoid the expense of repeating the (slow) SSL handshake to establish a
  507. new SSL session and obtain another session id (even if the client
  508. attempts to re\-use a session id, the server may force the client to
  509. renegotiate a session). By default
  510. .B httperf
  511. reuses the session id across all connections in a session. If the
  512. .B \-\-ssl\-no\-reuse
  513. option is in effect, then
  514. .B httperf
  515. will not reuse the session id, and the entire SSL handshake will be
  516. performed for each new connection in a session.
  517. .TP
  518. .BI \-\-think\-timeout= X
  519. Specifies the maximum time that the server may need to initiate
  520. sending the reply for a given request. Note that this timeout value
  521. is added to the normal timeout value (see option
  522. .BR \-\-timeout ).
  523. When accessing static web content, it is usually not necessary to
  524. specify this option. However, when performing tests with long\-running
  525. CGI scripts, it may be necessary to use this option to allow for
  526. larger response\-times. The default value for this option is zero
  527. seconds, meaning that the server has to be able to respond within the
  528. normal timeout value.
  529. .TP
  530. .BI \-\-timeout= X
  531. Specifies the amount of time
  532. .I X
  533. that
  534. .B httperf
  535. is willing to wait for a server reaction. The timeout is specified in
  536. seconds and can be a fractional number (e.g.,
  537. .BR "\-\-timeout 3.5" ).
  538. This timeout value is used when establishing a TCP connection, when
  539. sending a request, when waiting for a reply, and when receiving a
  540. reply. If during any of those activities a request fails to make
  541. forward progress within the alloted time,
  542. .B httperf
  543. considers the request to have died, closes the associated connection
  544. or session and increases the
  545. .B client\-timo
  546. error count. The actual timeout value used when waiting for a reply
  547. is the sum of this timeout and the think\-timeout (see option
  548. .BR \-\-think\-timeout ).
  549. By default, the timeout value is infinity.
  550. .TP
  551. .BI \-\-uri= S
  552. Specifies that URI
  553. .I S
  554. should be accessed on the server. For some of the workload generators
  555. (e.g.,
  556. .BR \-\-wset ),
  557. this option specifies the prefix for the URIs being accessed.
  558. .TP
  559. .BI \-\-use\-timer\-cache
  560. This feature allows the user to specify whether they want to
  561. cache timestamps or not. Timestamps are not cached by default, but
  562. the user can enable caching if higher performance is more important
  563. than timing accuracy. For small response sizes, disabling timer
  564. caching reduced the performance of httperf by about
  565. 10%; for larger response sizes there was little or no effect.
  566. .TP
  567. .B \-v
  568. .TP
  569. .B \-\-verbose
  570. Puts
  571. .B httperf
  572. into verbose mode. In this mode, additional output such as the
  573. individual reply rate samples and connection lifetime histogram are
  574. printed.
  575. .TP
  576. .B \-V
  577. .TP
  578. .B \-\-version
  579. Prints the version of
  580. .BR httperf .
  581. .TP
  582. .BI \-\-wlog= B , F
  583. This option can be used to generate a specific sequence of URI
  584. accesses. This is useful to replay the accesses recorded in a server
  585. log file, for example. Parameter
  586. .I F
  587. is the name of a file containing the ASCII NUL separated list of URIs
  588. that should be accessed. If parameter
  589. .I B
  590. is set to
  591. .RB `` y '',
  592. .B httperf
  593. will wrap around to the beginning of the file when reaching the end of
  594. the list (so the list of URIs is accessed repeatedly). With
  595. .I B
  596. set to
  597. .RB `` n '',
  598. the test will stop no later than when reaching the end of the URI
  599. list.
  600. .TP
  601. .BI \-\-wsess= N1 , N2 , X
  602. Requests the generation and measurement of sessions instead of
  603. individual requests. A session consists of a sequence of bursts which
  604. are spaced out by the user think\-time. Each burst consists of a fixed
  605. number
  606. .I L
  607. of calls to the server
  608. .RI ( L
  609. is specified by option
  610. .BR \-\-burst\-length ).
  611. The calls in a burst are issued as follows: at first, a single call is
  612. issued. Once the reply to this first call has been fully received,
  613. all remaining calls in the burst are issued concurrently. The
  614. concurrent calls are issued either as pipelined calls on an existing
  615. persistent connection or as individual calls on separate connections.
  616. Whether a persistent connection is used depends on whether the server
  617. responds to the first call with a reply that includes a ``Connection:
  618. close'' header line. If such a line is present, separate connections
  619. are used.
  620. The option specifies the following parameters:
  621. .I N1
  622. is the total number of sessions to generate,
  623. .I N2
  624. is the number of calls per session, and
  625. .I X
  626. is the user think\-time (in seconds) that separates consecutive call
  627. bursts. For example, the options
  628. .RB `` "\-\-wsess=100,50,10 \-\-burst\-len 5" ''
  629. would result in 100 sessions with a total of 50 calls each. Since
  630. each burst has a length of 5 calls, a total of 10 call bursts would be
  631. generated per session. The user think\-time between call bursts would
  632. be 10 seconds. Note that user think\-time
  633. .I X
  634. denotes the time between receiving the last reply of the previous
  635. call burst and the sending of the first request of the next burst.
  636. A test involving sessions finishes as soon as the requested number
  637. .I N1
  638. of sessions have either failed or completed. A session is considered
  639. to have failed if any operation in a session takes longer than
  640. the timeouts specified by options
  641. .B \-\-timeout
  642. and
  643. .BR \-\-think\-timeout .
  644. In addition, a session also fails if the server returns a reply with a
  645. status code matching the one specified by option
  646. .BR \-\-failure\-status .
  647. .TP
  648. .BI \-\-wsesslog= N , X , F
  649. This specifies a session workload generator similar to
  650. .B \-\-wsess
  651. (please read that description first). With
  652. .B \-\-wsesslog
  653. though, many aspects of user sessions, including the number and
  654. sequence of URI's, request method, think\-time and burst\-length parameters,
  655. can be specified in an input file
  656. .I F.
  657. Two other parameters are retained from
  658. .B \-\-wsess,
  659. namely
  660. .I N,
  661. the number of sessions to initiate, and
  662. .I X,
  663. the burst\-to\-burst user think time (note that this becomes a default
  664. time since the input file
  665. .I F
  666. can also specify user think time on a per\-burst basis.
  667. A small example input file can most\-easily show the settable parameters:
  668. .br
  669. .br
  670. # Comment lines start with a ``#'' as the first
  671. .br
  672. # character. Lines with only whitespace delimit
  673. .br
  674. # sessions (multiple blank lines do not generate
  675. .br
  676. # ``null'' sessions). All other lines specify a
  677. .br
  678. # uri\-sequence (1 uri per line). If the first
  679. .br
  680. # character of the line is whitespace (e.g. space
  681. .br
  682. # or tab), the uri is considered to be part of a
  683. .br
  684. # burst that is sent out after the previous
  685. .br
  686. # non\-burst uri.
  687. .br
  688. .br
  689. # session 1 definition (this is a comment)
  690. .br
  691. /foo.html think=2.0
  692. .br
  693. /pict1.gif
  694. .br
  695. /pict2.gif
  696. .br
  697. /foo2.html method=POST contents='Post data'
  698. .br
  699. /pict3.gif
  700. .br
  701. /pict4.gif
  702. .br
  703. .br
  704. # session 2 definition
  705. .br
  706. /foo3.html method=POST contents="Multiline\\ndata"
  707. .br
  708. /foo4.html method=HEAD
  709. .br
  710. .br
  711. The above description specifies 2 sessions. The first session will
  712. start with a request for /foo.html. When the /foo.html response comes
  713. back, a burst of 2 requests will follow (/pict1.gif and /pict2.gif).
  714. When the last of those responses is received, a two second user think
  715. time is inserted before the next request of /foo2.html is issued.
  716. This request is sent as a POST. The posted data can be contained
  717. between single\- or double\-quotes. Newlines can appear within posted
  718. data as ``\\n'' or as a ``\\<CR>''. The /foo2.html response is
  719. followed by a burst request of /pict3.gif and /pict4.gif, which
  720. concludes this session. The second session is started some time after
  721. the first, as specified by the
  722. .B \-\-rate
  723. or
  724. .B \-\-period
  725. options.
  726. .br
  727. .br
  728. The second session consists of 2 requests separated by the default user think
  729. time as specified by the
  730. .I X
  731. parameter of the
  732. .B \-\-wsesslog
  733. option. If the
  734. .I N
  735. parameter of
  736. .B \-\-wsesslog
  737. is greater than the number of sessions defined in input file
  738. .I R F ,
  739. then the defined sessions are used repeatedly until
  740. .I N
  741. sessions have been created (i.e., the defined sessions are used in a
  742. round\-robin fashion).
  743. .br
  744. .br
  745. One should avoid using
  746. .B \-\-wsesslog
  747. in conjunction with other
  748. .B httperf
  749. options that also control session behavior and workload URI's, namely
  750. .B \-\-burst\-length,
  751. .B \-\-wsess,
  752. .B \-\-wlog,
  753. and
  754. .B \-\-wset.
  755. .TP
  756. .BI \-\-wset= N , X
  757. This option can be used to walk through a list of URIs at a given
  758. rate. Parameter
  759. .I N
  760. specifies the number of distinct URIs that should be generated and
  761. .I X
  762. specifies the rate at which new URIs are accessed. A rate of
  763. .B 0.25
  764. would mean that the same URI would be accessed four times in a row
  765. before moving on to the next URI. This type of access pattern is
  766. useful in generating a workload that induces a relatively predictable
  767. amount of traffic in the disk I/O subsystem of the server (assuming
  768. .I N
  769. and the accessed files are big enough to exceed the server's buffer
  770. cache). The URIs generated are of the form
  771. .I R prefix / path .html,
  772. where
  773. .I prefix
  774. is the URI prefix specified by option
  775. .B \-\-uri
  776. and
  777. .I path
  778. is generated as follows: for the
  779. .I R i \-th
  780. file in the working set, write down
  781. .I i
  782. in decimal, prefixing the number with as many zeroes as necessary
  783. to get a string that has as many digits as
  784. .I R N \-1.
  785. Then insert a slash character between each digit. For example,
  786. the 103rd file in a working set consisting of 1024 files would
  787. result in a path of
  788. .RB `` 0/1/0/3 ''.
  789. Thus, if the URI\-prefix is
  790. .BR /wset1024 ,
  791. then the URI being accessed would be
  792. .BR /wset1024/0/1/0/3.html .
  793. In other words, the files on the server need to be organized as a
  794. 10ary tree.
  795. .SH "OUTPUT"
  796. This section describes the statistics output at the end of each test
  797. run. The basic information shown below is printed independent of the
  798. selected workload generator.
  799. .PP
  800. .RS
  801. .br
  802. .B Total:
  803. connections 30000 requests 29997 replies 29997 test\-duration 299.992 s
  804. .PP
  805. .B Connection rate:
  806. 100.0 conn/s (10.0 ms/conn, <=14 concurrent connections)
  807. .br
  808. .B Connection time [ms]:
  809. min 1.4 avg 3.0 max 163.4 median 1.5 stddev 7.3
  810. .br
  811. .B Connection time [ms]:
  812. connect 0.6
  813. .br
  814. .B Connection length [replies/conn]:
  815. 1.000
  816. .PP
  817. .B Request rate:
  818. 100.0 req/s (10.0 ms/req)
  819. .br
  820. .B Request size [B]:
  821. 75.0
  822. .PP
  823. .B Reply rate [replies/s]:
  824. min 98.8 avg 100.0 max 101.2 stddev 0.3 (60 samples)
  825. .br
  826. .B Reply time [ms]:
  827. response 2.4 transfer 0.0
  828. .br
  829. .B Reply size [B]:
  830. header 242.0 content 1010.0 footer 0.0 (total 1252.0)
  831. .br
  832. .B Reply status:
  833. 1xx=0 2xx=29997 3xx=0 4xx=0 5xx=0
  834. .PP
  835. .B CPU time [s]:
  836. user 94.31 system 205.26 (user 31.4% system 68.4% total 99.9%)
  837. .br
  838. .B Net I/O:
  839. 129.6 KB/s (1.1*10^6 bps)
  840. .PP
  841. .B Errors:
  842. total 3 client\-timo 0 socket\-timo 0 connrefused 3 connreset 0
  843. .br
  844. .B Errors:
  845. fd\-unavail 0 addrunavail 0 ftab\-full 0 other 0
  846. .br
  847. .RE
  848. .PP
  849. There are six groups of statistics: overall results (``Total''),
  850. connection related results (``Connection''), results relating to the
  851. issuing of HTTP requests (``Request''), results relating to the replies
  852. received from the server (``Reply''), miscellaneous results relating to
  853. the CPU (``CPU'') and network (``Net I/O'') utilization and, last but not
  854. least, a summary of errors encountered (``Errors'').
  855. .TP
  856. Total Section
  857. .br
  858. This section summarizes how many TCP connections were initiated by
  859. .BR httperf ,
  860. how many requests it sent out, how many replies it received, and
  861. what the total test duration was. In the example output
  862. shown above, 30,000 connections were created, 29,997 requests were
  863. sent out and 29,997 replies were received. The duration of the
  864. test was almost exactly 5 minutes (300 seconds).
  865. .TP
  866. Connection Section
  867. .br
  868. This section conveys information related to TCP connections generated
  869. by the tool. Specifically, the ``Connection rate'' line shows that new
  870. connections were initiated at a rate of 100.0 connections per second.
  871. This rate corresponds to a period of 10.0 milliseconds per
  872. connection. The last number in this line shows that at most 14
  873. connections were open at any given time.
  874. The first line labeled ``Connection time'' gives lifetime statistics
  875. for successful connections. The lifetime of a connection is the time
  876. between a TCP connection is initiated and the time the connection is
  877. closed. A connection is considered successful if it had at least one
  878. call that completed successfully. In the example output, the line
  879. indicates that the minimum (``min'') connection lifetime was 1.4
  880. milliseconds, the average (``avg'') lifetime was 3.0 milliseconds, the
  881. maximum (``max'') was 163.4 milliseconds, the median (``median'')
  882. lifetime was 1.5 milliseconds, and that the standard deviation of the
  883. lifetimes was 7.3 milliseconds. The median lifetime is computed based
  884. on a histogram with one millisecond resolution and a maximum lifetime
  885. of 100 seconds. Thus, the median is accurate to within half a
  886. millisecond if at least half of the successful connections have a
  887. lifetime of no more than 100 seconds.
  888. The next statistic in this section is the average time it took to
  889. establish a TCP connection. Only successful TCP connection
  890. establishments are counted. In the example, the second line labeled
  891. ``Connection time'' shows that, on average, it took 0.6 milliseconds
  892. to establish a connection.
  893. The final line in this section is labeled ``Connection length.'' It
  894. gives the average number of replies received on each connection that
  895. received at least one reply (i.e., connections that failed before
  896. yielding the first reply are not counted). This number can be bigger
  897. than 1.0 due to persistent connections.
  898. .TP
  899. Request Section
  900. .br
  901. The line labeled ``Request rate'' gives the rate at which HTTP requests
  902. were issued and the period that this rate corresponds to. In the
  903. example above, the request rate was 100.0 requests per second, which
  904. corresponds to 10.0 milliseconds per request. As long as no
  905. persistent connections are employed, the results in this section are
  906. very similar or identical to results in the connection section.
  907. However, when persistent connections are used, several calls can be
  908. performed on a single connection in which case the results would be
  909. different.
  910. The line labeled ``Request size'' gives the average size of the HTTP
  911. requests in bytes. In the example above, the average request size was
  912. 75 bytes.
  913. .TP
  914. Reply Section
  915. .br
  916. For simple measurements, this section is often the most interesting
  917. one as the line labeled ``Reply rate'' gives various statistics for
  918. the reply rate. In the example above, the minimum (``min'') reply
  919. rate was 98.8 replies per second, the average (``avg'') was 100
  920. replies per second, and the maximum (``max'') rate was 101.2 replies
  921. per second. The standard deviation was 0.3 replies per second. The
  922. number enclosed in parentheses shows that 60 reply rate samples were
  923. acquired. At present,
  924. .B httperf
  925. collects a rate sample once every five seconds. To obtain a
  926. meaningful standard deviation, it is recommended to run tests long
  927. enough so at least thirty samples are obtained. This corresponds to a
  928. test duration of at least 150 seconds.
  929. The line labeled ``Reply Time'' gives information on how long it took
  930. for the server to respond and how long it took to receive the reply.
  931. In the example, it took on average 2.4 milliseconds between sending
  932. the first byte of the request and receiving the first byte of the
  933. reply. The time to ``transfer'', or read, the reply was too short to
  934. be measured, so it shows up as zero. The is typical when the entire
  935. reply fits into a single TCP segment.
  936. The next line, labeled ``Reply size'' contains statistics on the
  937. average size of the replies\-\-\-all numbers are in reported bytes.
  938. Specifically, the line lists the average length of reply headers, the
  939. content, and footers (HTTP/1.1 uses footers to realize the ``chunked''
  940. transfer encoding). For convenience, the average total number of
  941. bytes in the replies is also given in parentheses. In the example,
  942. the average header length (``header'') was 242 bytes, the average
  943. content length (``content'') was 1010 bytes, and there were no footers
  944. (``footer'' length is zero). The total reply length of 1252 bytes on
  945. average.
  946. The final line in this section is a histogram of the major status
  947. codes received in the replies from the server. The major status code
  948. is the ``hundreds''\-digit of the full HTTP status code. In the
  949. example, all 29,997 replies had a major status code of 2. It's a good
  950. guess that all status codes were ``200 OK'' but the information in the
  951. histogram is not detailed enough to allow distinguishing status codes
  952. with the same major code.
  953. .TP
  954. Miscellaneous Section
  955. .br
  956. This section starts with a summary of the CPU utilization on the
  957. client machine. In the example, the line labeled ``CPU time'' shows
  958. that 94.31 seconds were spent executing in user mode (``user''),
  959. 205.26 seconds were spent executing in system mode (``system'') and
  960. that this corresponds to 31.4% user mode execution and 68.4% system
  961. execution. The total utilization was 99.9%, which is expected given
  962. that
  963. .B httperf
  964. is a CPU hog. A total CPU utilization of significantly less than 100%
  965. is a sign that there were competing processes that interfered with the
  966. test.
  967. The line labeled ``Net I/O'' gives the average network throughput in
  968. kilobytes per second (where a kilobyte is 1024 bytes) and in megabits
  969. per second (where a megabit is 10^6 bits). In the example, an average
  970. network usage of about 129.6 kilobytes per second was sustained. The
  971. number in parentheses shows that this corresponds to about 1.1
  972. megabits per second. This network bandwidth is computed based on the
  973. number of bytes sent and received on the TCP connections. In other
  974. words, it does not account for the network headers or TCP
  975. retransmissions that may have occurred.
  976. .TP
  977. Errors Section
  978. .br
  979. The last section contains statistics on the errors that were
  980. encountered during a test. In the example, the two lines labeled
  981. ``Errors'' show that there were a total of three errors and that all
  982. three errors were due to the server refusing to accept a connection
  983. (``connrefused''). A description of each error counter follows:
  984. .B client\-timo:
  985. The number of times a session, connection, or call failed due
  986. to a client timeout (as specified by the
  987. .B \-\-timeout
  988. and
  989. .BR \-\-think\-timeout )
  990. options.
  991. .B socket\-timo:
  992. The number of times a TCP connection failed with a socket\-level
  993. timeout (ETIMEDOUT).
  994. .B connrefused:
  995. The number of times a TCP connection attempt failed with a
  996. ``connection refused by server'' error (ECONNREFUSED).
  997. .B connreset:
  998. The number of times a TCP connection failed due to a RESET from the
  999. server. Typically, a RESET is received when the client attempts to
  1000. send data to the server at a time the server has already closed its
  1001. end of the connection. NT servers also send RESETs when attempting to
  1002. establish a new connection when the listen queue is full.
  1003. .B fd\-unavail:
  1004. The number of times the
  1005. .B httperf
  1006. process was out of file descriptors. Whenever this count is non\-zero,
  1007. the test results are meaningless because the client was overloaded
  1008. (see section "CHOOSING TIMEOUT VALUES").
  1009. .B addrunavail:
  1010. The number of times the client was out of TCP port numbers
  1011. (EADDRNOTAVAIL). This error should never occur. If it does, the
  1012. results should be discarded.
  1013. .B ftab\-full:
  1014. The number of times the system's file descriptor table is full.
  1015. Again, this error should never occur. If it does, the results should
  1016. be discarded.
  1017. .B other:
  1018. The number of times some other type of error occurred. Whenever this
  1019. counter is non\-zero, it is necessary to track down the real cause of
  1020. the error. To assist in doing this,
  1021. .B httperf
  1022. prints the error code (errno) of the first unknown errors that occurs
  1023. during a test run.
  1024. .RE
  1025. .PP
  1026. When
  1027. .B \-\-wsess
  1028. or
  1029. .B \-\-wsesslog
  1030. is specified,
  1031. .B httperf
  1032. generates and measures sessions instead of individual calls and
  1033. additional statistics are printed at the end of a test. An example
  1034. output is shown below.
  1035. .PP
  1036. .RS
  1037. .B Session rate [sess/s]:
  1038. min 0.00 avg 0.59 max 2.40 stddev 0.37 (240/450)
  1039. .br
  1040. .B Session:
  1041. avg 6.45 connections/session
  1042. .br
  1043. .B Session lifetime [s]:
  1044. 123.9
  1045. .br
  1046. .B Session failtime [s]:
  1047. 58.5
  1048. .br
  1049. .B Session length histogram:
  1050. 4 7 4 ... 3 3 240
  1051. .RE
  1052. .PP
  1053. The line labeled ``Session rate'' shows the minimum, average, and
  1054. maximum rate at which sessions completed (based on a 5 second sampling
  1055. interval). It also shows the standard deviation of the session
  1056. completion rate. The numbers in parentheses show how many sessions
  1057. succeeded and how many sessions were initiated. In the example above,
  1058. the minimum, average, and maximum session completion rates were 0.00,
  1059. 0.59, and 2.40 sessions per second, respectively. The standard
  1060. deviation was 0.37 sessions per second and 240 out of 450 sessions
  1061. completed successfully (210 failed due to errors such as timeouts).
  1062. The next line, labeled ``Session:'' shows the average length of a
  1063. session measured in connections. In the example above, an average of
  1064. 6.45 connections were required to complete a session.
  1065. The line labeled ``Session lifetime'' gives the average time it took
  1066. to complete a successful session. In the example above, it took an
  1067. average of 123.9 seconds.
  1068. The line labeled ``Session failtime'' gives the average time it took
  1069. before an unsuccessful session failed. In the example above, it took
  1070. on average 58.5 seconds for a session to fail.
  1071. Finally, the line labeled ``Session length histogram'' gives a
  1072. histogram of the number of replies received by each session. In the
  1073. example above, 4 sessions ended after receiving no reply at all, 7
  1074. ended after receiving one reply, and so on (the ellipsis indicates
  1075. additional histogram counts that were omitted from this manual for
  1076. space reasons). Note that this histogram does not distinguish between
  1077. successful and failed sessions.
  1078. .SH "CHOOSING TIMEOUT VALUES"
  1079. Since the machine that
  1080. .B httperf
  1081. runs on has only a finite set of resource available, it can not
  1082. sustain arbitrarily high HTTP loads. For example, one limiting factor
  1083. is that there are only roughly 60,000 TCP port numbers that can be in
  1084. use at any given time. Since on most UNIX systems it takes one minute
  1085. for a TCP connection to be fully closed (leave the TIME_WAIT state),
  1086. the maximum rate a client can sustain is at most 1,000 requests per
  1087. second.
  1088. The actual sustainable rate is often much lower than that because
  1089. before running out of TCP ports, the machine is likely to run out of
  1090. file descriptors (one file descriptor is used up for each open TCP
  1091. connection). By default, HP\-UX 10.20 allows 1,024 open file
  1092. descriptors per process. This means that without extra precautions,
  1093. .B httperf
  1094. could potentially very quickly use up all available file descriptors,
  1095. at which point it could not induce any additional load on the server.
  1096. To avoid this problem,
  1097. .B httperf
  1098. provides option
  1099. .B \-\-timeout
  1100. to set a timeout for all communication with the server. If the server
  1101. does not respond before the timeout expires, the client considers the
  1102. corresponding session, connection, or call to be ``dead,'' closes the
  1103. associated TCP connection, and increases the ``client\-timo'' error
  1104. count. The only exception to this rule is that after sending an
  1105. entire request to the server,
  1106. .B httperf
  1107. allows the server to take some additional time before it starts
  1108. sending the reply. This is to accommodate HTTP requests that take a
  1109. long time to complete on the server. This additional time is called
  1110. the ``server think time'' and can be specified by option
  1111. .BR \-\-think\-timeout .
  1112. By default, this additional think time is zero seconds, so the server
  1113. would always have to respond within the time alloted by option
  1114. .BR \-\-timeout .
  1115. Timeouts allow
  1116. .B httperf
  1117. to sustain high offered loads even when the server is overloaded. For
  1118. example, with a timeout of 2 seconds and assuming that 1,000
  1119. file\-descriptors are available, the offered load could be up to 500
  1120. requests per second (in practice, the sustainable load is often
  1121. somewhat smaller than the theoretical value). On the downside,
  1122. timeouts artificially truncate the connection lifetime distribution.
  1123. Thus, it is recommended to pick a timeout value that is as large as
  1124. possible yet small enough to allow sustaining the desired offered
  1125. rate. A timeout as short as one second may be acceptable, but larger
  1126. timeouts (5\-10 seconds) are preferable.
  1127. It is important to keep in mind that timeouts do not guarantee that a
  1128. client can sustain a particular offered load\-\-\-there are many other
  1129. potential resource bottlenecks. For example, in some cases the client
  1130. machine may simply run out of CPU time. To ensure that a given test
  1131. really measured the server's capabilities and not the client's, it is
  1132. a good idea to vary the number of machines participating in a test.
  1133. If observed performance remains the same as the number of client
  1134. machines is varied, the test results are likely to be valid.
  1135. .SH "AUTHOR"
  1136. .BR httperf
  1137. was developed by David Mosberger and was heavily influenced by an
  1138. earlier tool written by Tai Jin. Stephane Eranian contributed the
  1139. log\-file based URI generator. Dick Carter contributed the
  1140. .B \-\-wsesslog
  1141. workload generator, the support behind the
  1142. .B \-\-period
  1143. option, and bug fixes. Ted Bullock has taken over maintenance and
  1144. development activities since September 2006.
  1145. .SH "BUGS"
  1146. Probably many. Always be sure to double\-check results and don't fall
  1147. prey to measuring client\-performance instead of server performance!
  1148. .PP
  1149. The user\-interface definitely could be improved. A simple workload
  1150. description language might be more suitable than the dozens of little
  1151. command\-line options the tool has right now.