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

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

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

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

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

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

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

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

D:\wamp\bin\apache\Apache2.2.21\bin>ab -n 10 -c 10 http://m.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 m.fzitv.net (be patient)…..done

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

Server Hostname:        m.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  //整個(gè)測試持續(xù)的時(shí)間

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

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

Write errors:           0

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

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

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

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

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

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

              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

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

-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)文章

最新評論

萨迦县| 西贡区| 琼海市| 资兴市| 左权县| 恩施市| 德保县| 永兴县| 庄河市| 萍乡市| 固镇县| 宣化县| 吉隆县| 彰化县| 吴堡县| 海安县| 正安县| 丹凤县| 威远县| 桐梓县| 柳林县| 临江市| 嘉荫县| 柞水县| 兰州市| 泌阳县| 大埔县| 新化县| 靖西县| 西畴县| 兴海县| 三明市| 博客| 沙坪坝区| 陕西省| 龙游县| 那曲县| 北宁市| 奉化市| 镇康县| 巴中市|