最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Apache AB性能測試工具使用教程

 更新時間:2014年10月24日 09:29:45   投稿:junjie  
這篇文章主要介紹了Apache AB性能測試工具使用教程,本文重點(diǎn)講解測試結(jié)果中的一些參數(shù),對參數(shù)的含義一一解釋,需要的朋友可以參考下

服務(wù)器負(fù)載太大而影響程序效率是很常見的,Apache服務(wù)器自帶有一個叫ab(ApacheBench)的工具,在bin目錄下。ab專門用于HTTP Server的benchmark testing,可以同時模擬多個并發(fā)請求,使用這個輕巧的工具我們可以對服務(wù)器進(jìn)行負(fù)載測試。

今天在公司也用它作一些測試,現(xiàn)在整理了下它的一些東西分享下。

首先我們要得到Apache服務(wù)器的目錄下bin的路徑,我電腦中的路徑是D:\wamp\bin\apache\Apache2.2.21\bin,打開cmd,轉(zhuǎn)到這個目錄下,在其中輸入:ab -n 10 -c 10 http://www.fzitv.net/ 這條指令,這條指令的意思是:ab -n 全部請求數(shù) -c 并發(fā)數(shù) 測試URL。這里值得注意的是,如果你的測試URL是一個網(wǎng)站的網(wǎng)址,請記得在其后加上/,否則會無法工作。

以下是我運(yùn)行的結(jié)果:

復(fù)制代碼 代碼如下:

D:\wamp\bin\apache\Apache2.2.21\bin>ab -n 10 -c 10 http://www.fzitv.net/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.fzitv.net (be patient)…..done

Server Software:        Microsoft-IIS/6.0  //Microsoft-IIS服務(wù)器版本6.0

Server Hostname:        www.fzitv.net  //服務(wù)器主機(jī)名

Server Port:            80  //服務(wù)器端口
Document Path:          /  //測試的頁面文檔

Document Length:        32639 bytes  //文檔大小
Concurrency Level:      10  //并發(fā)數(shù)

Time taken for tests:   13.548 seconds  //整個測試持續(xù)的時間

Complete requests:      10  //完成的請求數(shù)量

Failed requests:        0  //失敗的請求數(shù)量

Write errors:           0

Total transferred:      331070 bytes  //整個場景中的網(wǎng)絡(luò)傳輸量

HTML transferred:       326390 bytes  //整個場景中的HTML內(nèi)容傳輸量

Requests per second:    0.74 [#/sec] (mean)  //每秒事務(wù)數(shù) ,后面括號中的 mean 表示這是一個平均值

Time per request:       13547.775 [ms] (mean)  //平均事務(wù)響應(yīng)時間 ,后面括號中的 mean 表示這是一個平均值

Time per request:       1354.777 [ms] (mean, across all concurrent requests)  //每個請求實(shí)際運(yùn)行時間的平均值

Transfer rate:          23.86 [Kbytes/sec] received  //平均每秒網(wǎng)絡(luò)上的流量,可以幫助排除是否存在網(wǎng)絡(luò)流量過大導(dǎo)致響應(yīng)時間延長的問題
Connection Times (ms)  //網(wǎng)絡(luò)上消耗的時間的分解

              min  mean[+/-sd] median   max

Connect:        1    2   0.8      2       3

Processing:  2163 3981 3420.2   2957   13540

Waiting:     1305 3204 3595.3   2096   13169

Total:       2164 3983 3420.0   2959   13541

//以下是整個場景中所有請求的響應(yīng)情況。在場景中每個請求都有一個響應(yīng)時間,其中50%的用戶響應(yīng)時間小于2959毫秒,66% 的用戶響應(yīng)時間小于3074毫秒,最大的響應(yīng)時間小于13541 毫秒。由于對于并發(fā)請求,cpu實(shí)際上并不是同時處理的,而是按照每個請求獲得的時間片逐個輪轉(zhuǎn)處理的,所以基本上第一個Time per request時間約等于第二個Time per request時間乘以并發(fā)請求數(shù)。

Percentage of the requests served within a certain time (ms)

  50%   2959

  66%   3074

  75%   3974

  80%   4008

  90%  13541

  95%  13541

  98%  13541

  99%  13541

 100%  13541 (longest request)

下面是ab的指令中參數(shù)的介紹:

復(fù)制代碼 代碼如下:

-n requests     全部請求數(shù)

-c concurrency  并發(fā)數(shù)

-t timelimit    最傳等待回應(yīng)時間

-p postfile     POST數(shù)據(jù)文件

-T content-type POST Content-type

-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    加入cookie, eg. ‘Apache=1234. (repeatable)

-H attribute    加入http頭, eg. ‘Accept-Encoding: gzip'

                Inserted after all normal header lines. (repeatable)

-A attribute    http驗(yàn)證,分隔傳遞用戶名及密碼

-P attribute    Add Basic Proxy Authentication, the attributes

                are a colon separated username and password.

-X proxy:port   代理服務(wù)器

復(fù)制代碼 代碼如下:

-V              查看ab版本

-k              Use HTTP KeepAlive feature

-d              Do not show percentiles served table.

-S              Do not show confidence estimators and warnings.

-g filename     Output collected data to gnuplot format file.

-e filename     Output CSV file with percentages served

-h              Display usage information (this message)

相關(guān)文章

最新評論

新闻| 安岳县| 绿春县| 葵青区| 永顺县| 手机| 神农架林区| 民县| 英超| 满城县| 吴江市| 揭阳市| 西藏| 手游| 延川县| 应城市| 阿荣旗| 阿巴嘎旗| 邳州市| 雅江县| 仁布县| 巴林右旗| 辽源市| 加查县| 土默特右旗| 梁山县| 南涧| 祁阳县| 房山区| 丽水市| 怀安县| 博白县| 姚安县| 铅山县| 民丰县| 阿坝| 汪清县| 凯里市| 巢湖市| 西平县| 天等县|