1 AB Mounting
AB is actually a tool or submodule inside Apache httpd, and installing Apache httpd can refer to another article in the 2.3 section of the JBoss cluster
Installation directory:/apache directory/bin/, as follows
2 parameter explanation
-A Auth-username:password some requests require a username and password for authentication: (For example: 401 authentication requirements).-B windowsize TCP sends and receives a buffer size in bytes-c concurrency concurrency, the number of requests sent at the same time, the default is 1. -C Cookie-name=value plus cookies: in the form of "Name=value", you can repeat the-C xx1=yy1-c xx2=yy2. -D does not show "percentage served within XX [MS] table".-e Csv-file write a comma-delimited CSV file containing the time (in milliseconds) that each percentage (from 1% to 100%) server executes, this file is generally is more useful than ' gunplot '. -F protocol Specifies the SSL/TLS protocol (SSL2, SSL3, TLS1, or All).-G Gnuplot-file Write all useful information to the TSV (Tab separate values) file, which can be easily imported into Excel Wait inside, label on the first line of the file. -H Display Help information-H custom-header Add additional header information. Split with a colon, for example ("Accept-encoding:zip/zop;8bit")-I sends a GET request-K to open the KeepAlive feature of HTTP. Executes multiple requests in an HTTP session. Default does not open. -N Requests the number of request checksums to execute. The default request once, the result of the request does not represent the verification result, is inaccurate. -P Post-file contains the POST data file-P Proxy-auth-username:password supports basic auth proxy route validation. At (required for HTTP code:407)-Q when the program has 150 requests, the output is displayed for every 10% or 100. -Q is used to cancel this information. -R does not exit when the socket is wrong. -S if used in the SSL protocol, the function is still in the experimental phase, you do not need to use it. -S does not display termination and standard values, nor does it display warning messages. The maximum time that the-T TimeLimit Checksum takes, internally set-n 50,000 times. Use this option to test within a specific time period. The-T Content-type is not turned on by default forPost/put data, such as eg. Application/x-www-form-urlencoded. Default:text/plain.-u put-file PUT file, remember to add-t-v verbosity set output level, 4 output header information, 3 output response code (404,200) 2 output warning and information-v display version, and then exit 。 -W output results to table in HTML, default two columns, white background. -x-attributes String to use as attributes for. Attributes is Inserted.-x proxy[:p ort] use a proxy. -y-attributes setting properties to.-z-attributes
Sets the property to.
-Z Ciphersuite
Specifies the SSL/TLS cipher suite (see OpenSSL ciphers).
3 Execute command
Syntax format:
AB[ -Aauth-username:password] [ -bwindowsize] [ -Cconcurrency] [ -Ccookie-name=value] [ -D] [ -ecsv-file] [ -Fprotocol] [ -ggnuplot-file] [ -h] [ -Hcustom-header] [ -I] [ -k] [ -Nrequests] [ -PPOST-file] [ -Pproxy-auth-username:password] [ -Q] [ -R] [ -s] [ -S] [ -Ttimelimit] [ -Tcontent-type] [ -uPUT-file] [ -vverbosity] [ -V] [ -W] [ -x<table>-attributes] [ -Xproxy[:port] ] [ -y<tr>-attributes] [ -Z<td>-attributes] [ -Zciphersuite] [http[s]://]hostname[:port]/path
Test results and explanations (from the network):
[email protected] ~]# ab-n 100-c http://www.baidu.com/###-n: Number of requests issued by-C: Concurrency per time this is Apachebe NCH, Version 2.0.40-dev<$Revision:1.146 $> Apache-2.0copyright 1996 Adam Twiss, Zeus technology LTD, Http://www.zeustech.net/Copyright 2006 the Apache software Foun Dation, http://www.apache.org/Benchmarking www.baidu.com (Be patient) ... doneserver software:bws/1.0 # # #服务器的信息Server Hostname:www.baidu.com # # #域名Server port:80 # # #连接的端口Document Path: /# # #请求的URIDocument length:10530 bytes # # #第一次返回文档的大小. If the size of the document changes during testing, the response is considered an error. Concurrency Level:10 # # #并发数Time taken for tests:29.32944 seconds # # #开始到结束的时间Complete requests: # # # #成功的请求数Failed requests:42 # #失败的请求数 (connect:0, length:42, Exceptions: 0) # # #详细的多少个连接失败, length exception, read failed write errors:0 # # #在发送的时候失败的次数Total transferred:1131908 bytes # # #从服务器接收的字节数. This is the explicit network send byte. HTML transferred:1084140 Bytes # #html内容传输量Requests per second:3.44 [#/sec] (mean) # # #每秒请求数TimePer request:2903.294 [MS] (mean) # #每个并发的时间Time per request:290.329 [MS] (mean, across all concurrent requests) # # #个人理解是每个并发中每个请求的时间Transfer rate:38.06 [Kbytes/sec] received # # #每秒的网络流量Connection times (ms) min MEAN[+/-SD] Median maxconnect:37 1003 809.6 898 4056 # # #socket发出请求到建立连接所花的时间. processing:253 1713 861.2 1800 5643 # # #连接建立后 until the time that HTTP is all received. WAITING:42 759 711.5 715 4886 # # #发送http完后, the time to wait for the first byte to be received. total:336 2717 1248.4 2739 6655 # # #conn +processing## #下面的内容为整个场景中所有请求的响应情况. Each request in the scene has a response time, where 50% of the user's response time is less than 3064 milliseconds, 60 of the user response time is less than 3094 milliseconds, and the maximum response time is less than 3184 milliseconds percentage of the requests served within A certain time (ms) 50% 273966% 301775% 314180% 318790% 399895% 560798% 609599% 6655100% 6655 (longest request)
4 About-P (post file)
About post file, the personal feeling of this is a very gnawing dad's problem, the online information is very few, the official website is not detailed, so that I pass the file parameters in the form of post, found that the server received the request, but did not receive the post data , But if you add the Paramname=paramvalue directly to the address, you can be sure that the format or encoding of the file on the-P side is a requirement, except that it does not find the relevant instructions.
Summary if you want to use post file, note
A. Content-type must be set to be application/x-www-form-urlencoded, i.e. - t ' application/ X-www-form-urlencoded '
B. About-P files, followed by this file is best to create with the VI command, if it is txt may fail
C. Contents of the document test1=a&test2=b
AB Pressure measurement notes (Apache Bench)