Ab use of stress test tools
[[email protected] ~]# ab -n1000 -c10 http://192.168.116.193/index.html #表示每次并发10个请求, a total of 1000 requests this is apachebench, version 2.3< $Revision: 655654 $>copyright 1996 adam twiss, zeus technologyltd, http:// www.zeustech.net/Licensed to The Apache Software Foundation,http://www.apache.org/ Benchmarking 192.168.116.193 (be patient) completed 100 requestscompleted 200 requestscompleted 300 requestscompleted 400 requestscompleted 500 requestscompleted 600 requestscompleted 700 requestscompleted 800 Requestscompleted 900 requestscompleted 1000 requestsfinished 1000 requests Server Software: nginx/1.0.15 #平台apache Version server hostname: 192.168.116.193 #服务器主机名Server Port: 80 #服务器端口 document path: / index.html # Test the page document length: 3698 bytes #测试页面大小 concurrency Level: 10 #并发数Time taken for tests: 0.577 seconds #整个测试耗时Complete requests: 1000 # Total number of requests completed failed requests: 0 #表示失败的总请求数, the failure here refers to the request in connection with the server, send data, receive data and other aspects of the exception, and no response timeout, etc. write errors: 0 # Number of network connection write errors Total transferred: 3917820 bytes #测试过程中产生的网络传输总量HTML transferred: 3705396 bytes # The amount of HTML traffic generated during the test requests per second: 1733.55 [#/sec] (mean) #表示服务器吞吐量, number of transactions per second, mean in parentheses this is an average time per request: 5.768 [ms] (mean) #表示用户请求的平均响应时间, mean in parentheses indicates that this is an average time per request: 0.577 [ms] (mean, across all concurrentrequests) # Represents the average server request processing time, which is the average of the actual elapsed time transfer rate: 6632.57 [kbytes/sec] received #表示这些请求在单位时间内从服务器获取的数据长度 to help troubleshoot problems with extended response times due to excessive network traffic Connection Times (MS) &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;MIN&NBSP;&NBSP;MEAN[+/-SD] median maxconnect: 0 2 5.5 2 85Processing: 1 3 6.3 2 84Waiting: 0 2 5.1 2 82Total: 2 5 8.8 4 100# the decomposition of the time consumed on the network, representing the length of data that these requests get from the server within a unit of time percentage of the requests served within acertain time (MS) 50% 4 66% 5 75% 5 80% 5 90% 6 95% 9 98% 19 99% 80 100% 100 (longest request) #整个场景中所有请求的响应情况. Each request in the scene has a response time, where 50% of the user's response time is less than 4 milliseconds, 60% of the user response time is less than 5 milliseconds, and the maximum response time is less than 100 milliseconds
Ab Command parameter comments:
-N #指定在测试会话中所执行的请求个数. By default, only one request is executed. -C #指定一次产生的请求个数. The default is one at a time. -T #测试所进行的最大秒数. Its internal implied value is-n 50000. It allows you to limit the testing of the server to a fixed total time. By default, there is no time limit. -P #包含了需要POST的数据的文件. -T #POST数据所使用的Content-type header information. -V #设置显示信息的详细程度-4 or greater displays header information, 3 or greater values can display response codes (404, 200, etc.), and 2 or greater values can display warnings and other information. -V Displays the version number and exits. -W #以HTML表的格式输出结果. By default, it is a table with a two-column width on a white background. -I #执行HEAD请求, not get.
This article is from "Gan nan has" blog, please be sure to keep this source http://changfei.blog.51cto.com/4848258/1661656
Test Site performance with the AB command