<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 基準測試工具(ab) ## 安裝ab win:如果本地有apache的開發環境,那么ab默認在apache目錄下的bin目錄下,打開bin目錄可以看到 linux:直接yum install httpd-tools,安裝即可 簡單上手 直接敲入下面代碼(注意切換ab所在的目錄) -c 10代表并發數是10 -n 10總共進行100次訪問 后面接要訪問的網址,切記不可缺少http:// `D:\phpStudy\Apache\bin>ab -c 10 -n 1000 http://example.com/phpinfo.php` #ab工具的描述,注意其中的版本號 ~~~ This is ApacheBench, Version 2.3 <$Revision: 1604373 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ #測試結果,共測試1000次,每100次顯示訪問進度,訪問的網站是example.com Benchmarking example.com (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests #服務器的信息 Server Software: nginx/1.6.2 #服務器web軟件 Server Hostname: example.com #主機地址 Server Port: 80 #訪問端口 #文檔信息 Document Path: /phpinfo.php #訪問的文檔 Document Length: 94804 bytes #返回結果大小字節數(包含html,js,css,圖片及響應中的所有內容字節數總和) #鏈接信息 Concurrency Level: 10 #并發數,-c 10 設置了10個并發 Time taken for tests: 7.498 seconds #總耗時,單位秒 Complete requests: 1000 #總共請求中已完成的請求總數的和 Failed requests: 219 #失敗的請求數總和 (Connect: 0, Receive: 0, Length: 219, Exceptions: 0) Non-2xx responses: 9 #未收到2xx系列成功的請求總數 Total transferred: 94135779 bytes #整個請求總數中響應總數距的總大小字節數,包含頭信息 HTML transferred: 93952076 bytes #整個請求總數中正文內容的總大小字節 Requests per second: 133.36 [#/sec] (mean) #每秒支持的并發數,這里是每秒支持133.36個并發 Time per request: 74.984 [ms] (mean) #完成一個請求的總耗時 Time per request: 7.498 [ms] (mean, across all concurrent requests) #完成所有并發請求中一個請求的總耗時 Transfer rate: 12259.83 [Kbytes/sec] received #每秒收到的字節總數(KB) #測試的時間結果數據,留意Total一項,10個并發的情況下,完成一個請求,最小耗時(min)9毫秒,最大耗時(max)146毫秒 Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.7 0 20 Processing: 9 74 22.2 68 146 Waiting: 6 73 22.1 67 143 Total: 9 74 22.2 68 146 #完成請求百分比,例如第一項,50% 68,代表一半的請求在68毫秒內完成,95% 129,代表1000的請求里,百分之九十八的請求在129毫秒里完成 Percentage of the requests served within a certain time (ms) 50% 68 66% 78 75% 86 80% 92 90% 109 95% 122 98% 129 99% 133 100% 146 (longest request) ~~~ ## ab選項 輸入下面命令得到ab幫助文檔,該幫助文檔,分別說明了用法和命令選項的含義 ~~~ Usage: ab [options] [http://]hostname[:port]/path Options are: -n requests Number of requests to perform -c concurrency Number of multiple requests to make at a time -t timelimit Seconds to max. to spend on benchmarking This implies -n 50000 -s timeout Seconds to max. wait for each response Default is 30 seconds -b windowsize Size of TCP send/receive buffer, in bytes -B address Address to bind to when making outgoing connections -p postfile File containing data to POST. Remember also to set -T -u putfile File containing data to PUT. Remember also to set -T -T content-type Content-type header to use for POST/PUT data, eg. 'application/x-www-form-urlencoded' Default is 'text/plain' -v verbosity How much troubleshooting info to print -w Print out results in HTML tables -i Use HEAD instead of GET -x attributes String to insert as table attributes -y attributes String to insert as tr attributes -z attributes String to insert as td or th attributes -C attribute Add cookie, eg. 'Apache=1234'. (repeatable) -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip' Inserted after all normal header lines. (repeatable) -A attribute Add Basic WWW Authentication, the attributes are a colon separated username and password. -P attribute Add Basic Proxy Authentication, the attributes are a colon separated username and password. -X proxy:port Proxyserver and port number to use -V Print version number and exit -k Use HTTP KeepAlive feature -d Do not show percentiles served table. -S Do not show confidence estimators and warnings. -q Do not show progress when doing more than 150 requests -l Accept variable document length (use this for dynamic pages) -g filename Output collected data to gnuplot format file. -e filename Output CSV file with percentages served -r Don't exit on socket receive errors. -m method Method name -h Display usage information (this message) ~~~ ~~~ -n 即requests,用于指定壓力測試總共的執行次數。 -c 即concurrency,用于指定壓力測試的并發數。 -t 即timelimit,等待響應的最大時間(單位:秒)。 -b 即windowsize,TCP發送/接收的緩沖大小(單位:字節)。 -p 即postfile,發送POST請求時需要上傳的文件,此外還必須設置-T參數。 -u 即putfile,發送PUT請求時需要上傳的文件,此外還必須設置-T參數。 -T 即content-type,用于設置Content-Type請求頭信息,例如:application/x-www-form-urlencoded,默認值為text/plain。 -v 即verbosity,指定打印幫助信息的冗余級別。 -w 以HTML表格形式打印結果。 -i 使用HEAD請求代替GET請求。 -x 插入字符串作為table標簽的屬性。 -y 插入字符串作為tr標簽的屬性。 -z 插入字符串作為td標簽的屬性。 -C 添加cookie信息,例如:"Apache=1234"(可以重復該參數選項以添加多個)。 -H 添加任意的請求頭,例如:"Accept-Encoding: gzip",請求頭將會添加在現有的多個請求頭之后(可以重復該參數選項以添加多個)。 -A 添加一個基本的網絡認證信息,用戶名和密碼之間用英文冒號隔開。 -P 添加一個基本的代理認證信息,用戶名和密碼之間用英文冒號隔開。 -X 指定使用的代理服務器和端口號,例如:"126.10.10.3:88"。 -V 打印版本號并退出。 -k 使用HTTP的KeepAlive特性。 -k 使用HTTP的KeepAlive特性。 -d 不顯示百分比。 -S 不顯示預估和警告信息。 -g 輸出結果信息到gnuplot格式的文件中。 -e 輸出結果信息到CSV格式的文件中。 -r 指定接收到錯誤信息時不退出程序。 -h 顯示用法信息,其實就是ab -help。 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看