apache性能測試工具ab
Posted on 2011-12-13 14:36 瘋狂 閱讀(1091) 評(píng)論(0) 編輯 收藏 所屬分類: java性能 、apache項(xiàng)目Apache自帶的測試工具ab(apache benchmark)在apache的bin目錄下。
使用格式: ./ab [options] [http://]hostname[:port]/path
參數(shù)說明:
-n requests Number of requests to perform
//在測試會(huì)話中所執(zhí)行的請(qǐng)求個(gè)數(shù)。默認(rèn)時(shí),僅執(zhí)行一個(gè)請(qǐng)求
-c concurrency Number of multiple requests to make
//一次產(chǎn)生的請(qǐng)求個(gè)數(shù)。默認(rèn)是一次一個(gè)。
-t timelimit Seconds to max. wait for responses
//測試所進(jìn)行的最大秒數(shù)。其內(nèi)部隱含值是-n 50000。它可以使對(duì)服務(wù)器的測試限制在一個(gè)固定的總時(shí)間以內(nèi)。默認(rèn)時(shí),沒有時(shí)間限制。
-p postfile File containing data to POST
//包含了需要POST的數(shù)據(jù)的文件.
-T content-type Content-type header for POSTing
//POST數(shù)據(jù)所使用的Content-type頭信息。
-v verbosity How much troubleshooting info to print
//設(shè)置顯示信息的詳細(xì)程度 - 4或更大值會(huì)顯示頭信息, 3或更大值可以顯示響應(yīng)代碼(404, 200等), 2或更大值可以顯示警告和其他信息。 -V 顯示版本號(hào)并退出。
-w Print out results in HTML tables
//以HTML表的格式輸出結(jié)果。默認(rèn)時(shí),它是白色背景的兩列寬度的一張表。
-i Use HEAD instead of GET
// 執(zhí)行HEAD請(qǐng)求,而不是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)
//-C cookie-name=value 對(duì)請(qǐng)求附加一個(gè)Cookie:行。其典型形式是name=value的一個(gè)參數(shù)對(duì)。此參數(shù)可以重復(fù)。
-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.
//-P proxy-auth-username:password 對(duì)一個(gè)中轉(zhuǎn)代理提供BASIC認(rèn)證信任。用戶名和密碼由一個(gè):隔開,并以base64編碼形式發(fā)送。無論服務(wù)器是否需要(即, 是否發(fā)送了401認(rèn)證需求代碼),此字符串都會(huì)被發(fā)送。
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d
使用格式: ./ab [options] [http://]hostname[:port]/path
參數(shù)說明: