欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

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

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

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

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

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

復制代碼 代碼如下:

D:\wamp\bin\apache\Apache2.2.21\bin>ab -n 10 -c 10 http://www.dbjr.com.cn/

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.dbjr.com.cn (be patient)…..done

Server Software:        Microsoft-IIS/6.0  //Microsoft-IIS服務器版本6.0

Server Hostname:        www.dbjr.com.cn  //服務器主機名

Server Port:            80  //服務器端口
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)絡傳輸量

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

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

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

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

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

              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

//以下是整個場景中所有請求的響應情況。在場景中每個請求都有一個響應時間,其中50%的用戶響應時間小于2959毫秒,66% 的用戶響應時間小于3074毫秒,最大的響應時間小于13541 毫秒。由于對于并發(fā)請求,cpu實際上并不是同時處理的,而是按照每個請求獲得的時間片逐個輪轉(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ù)的介紹:

復制代碼 代碼如下:

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

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

-t timelimit    最傳等待回應時間

-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驗證,分隔傳遞用戶名及密碼

-P attribute    Add Basic Proxy Authentication, the attributes

                are a colon separated username and password.

-X proxy:port   代理服務器

復制代碼 代碼如下:

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

相關文章

  • 技術小白也能搞定的Linux安裝Jenkins+cpolar教程!

    技術小白也能搞定的Linux安裝Jenkins+cpolar教程!

    親愛的技術小白,你是否曾想過在自己的Linux系統(tǒng)上安裝Jenkins和cpolar?如果你的答案是肯定的,那么恭喜你,你找對了地方,這個教程將教你如何輕松搞定這兩個強大的工具的安裝,讓你在技術世界里游刃有余,別再猶豫了,讓我們一起踏上這趟精彩的旅程吧!
    2024-02-02
  • apache啟用gzip壓縮的實現(xiàn)方法

    apache啟用gzip壓縮的實現(xiàn)方法

    對于部署在Linux服務器上的PHP程序,在服務器支持的情況下,我們建議你開啟使用Gzip Web壓縮,以前腳本之家介紹了iis中的開啟方法,這篇文章主要介紹了linux中apache的開啟方法
    2013-06-06
  • environments was not found on the java.library.path 問題的解決方法

    environments was not found on the java.library.path 問題的解決方法

    The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path 問題的解決方法,需要的朋友可以參考下
    2016-08-08
  • #實踐筆記#Ubuntu配置Apache+PHP+MySQL

    #實踐筆記#Ubuntu配置Apache+PHP+MySQL

    在我早先的一篇文章《#實踐筆記#本地配置PHPnow與WordPress》,已經(jīng)討論過PHPnow的本地安裝教程。但是PHPnow套件是Windows平臺下的軟件,不適用我現(xiàn)在使用的平臺
    2012-03-03
  • nmap掃描服務器端口(遠程桌面端口)

    nmap掃描服務器端口(遠程桌面端口)

    nmap是Linux下常用的端口掃描工具,它可以檢測主機是否在線,是否開啟了某個服務端口,使用了何種操作系統(tǒng)等,下面是安裝方法和使用方法
    2013-12-12
  • 解決Ubuntu19 安裝Theano問題

    解決Ubuntu19 安裝Theano問題

    這篇文章主要介紹了解決Ubuntu19 安裝Theano出現(xiàn)"No module named ‘theano.compat.six’"問題,需要的朋友可以參考下
    2019-12-12
  • Ubuntu中添加應用程序快速啟動器的方法

    Ubuntu中添加應用程序快速啟動器的方法

    這篇文章主要介紹了Ubuntu中添加應用程序快速啟動器的方法,需要的朋友可以參考下
    2014-09-09
  • 在 CentOS 8/RHEL 8 上安裝和使用 Cockpit的方法

    在 CentOS 8/RHEL 8 上安裝和使用 Cockpit的方法

    Cockpit 是一個基于 Web 的服務器管理工具,可用于 CentOS 和 RHEL 系統(tǒng)。最近發(fā)布的 CentOS 8 和 RHEL 8,其中 cockpit 是默認的服務器管理工具。這篇文章主要介紹了在 CentOS 8/RHEL 8 上安裝和使用 Cockpit的方法,需要的朋友可以參考下
    2019-10-10
  • Linux 中_exit和exit的區(qū)別

    Linux 中_exit和exit的區(qū)別

    這篇文章主要介紹了Linux 中_exit和exit的區(qū)別的相關資料,需要的朋友可以參考下
    2017-03-03
  • apache中使用mod_log_slow分析響應慢的請求

    apache中使用mod_log_slow分析響應慢的請求

    這篇文章主要介紹了apache中使用mod_log_slow分析響應慢的請求,使用mod_log_slow可以定位到響應慢的PHP代碼位置,需要的朋友可以參考下
    2014-06-06

最新評論