国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > Apache > 正文

使用Apache ab工具對(duì)Apache服務(wù)器進(jìn)行簡(jiǎn)單的壓力測(cè)試

2024-08-27 18:27:21
字體:
供稿:網(wǎng)友

1.安裝ab命令

sudo apt-get install apache2-utils 

2.ab命令參數(shù)說明

Usage: ab [options] [http[s]://]hostname[:port]/path 
Options are:  
  

//總的請(qǐng)求數(shù)  -n requests Number of requests to perform  //一次同時(shí)并發(fā)的請(qǐng)求數(shù) 總的請(qǐng)求數(shù)(n)=次數(shù)*一次并發(fā)數(shù)(c)  -c concurrency Number of multiple requests to make 

-n requests Number of requests to perform
//在測(cè)試會(huì)話中所執(zhí)行的請(qǐng)求個(gè)數(shù)(本次測(cè)試總共要訪問頁面的次數(shù))。默認(rèn)時(shí),僅執(zhí)行一個(gè)請(qǐng)求。
-c concurrency Number of multiple requests to make
//一次產(chǎn)生的請(qǐng)求個(gè)數(shù)(并發(fā)數(shù))。默認(rèn)是一次一個(gè)。
-t timelimit Seconds to max. wait for responses
//測(cè)試所進(jìn)行的最大秒數(shù)。其內(nèi)部隱含值是-n 50000。它可以使對(duì)服務(wù)器的測(cè)試限制在一個(gè)固定的總時(shí)間以內(nèi)。默認(rèn)時(shí),沒有時(shí)間限制。
-p postfile File containing data to POST
//包含了需要POST的數(shù)據(jù)的文件,文件格式如“p1=1&p2=2”.使用方法是 -p 111.txt 。 (配合-T)
-T content-type Content-type header for POSTing
//POST數(shù)據(jù)所使用的Content-type頭信息,如 -T “application/x-www-form-urlencoded” 。 (配合-p)
-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. -C “c1=1234,c2=2,c3=3″ (repeatable)
//-C cookie-name=value 對(duì)請(qǐng)求附加一個(gè)Cookie:行。 其典型形式是name=value的一個(gè)參數(shù)對(duì)。此參數(shù)可以重復(fù),用逗號(hào)分割。
提示:可以借助session實(shí)現(xiàn)原理傳遞 JSESSIONID參數(shù), 實(shí)現(xiàn)保持會(huì)話的功能,如
-C ” c1=1234,c2=2,c3=3, JSESSIONID=FF056CD16DA9D71CB131C1D56F0319F8″ 。
-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ā)送。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 盐山县| 肥乡县| 明光市| 上饶县| 沁阳市| 津南区| 茶陵县| 万载县| 潜江市| 黄大仙区| 科技| 嘉禾县| 革吉县| 福贡县| 桃园市| 揭东县| 和静县| 苍溪县| 海安县| 岚皋县| 枣阳市| 右玉县| 五河县| 雅江县| 浦东新区| 如皋市| 都昌县| 巩义市| 仙桃市| 全椒县| 乌拉特前旗| 浑源县| 阿尔山市| 张家港市| 桂林市| 霸州市| 建平县| 兴仁县| 普宁市| 新平| 蓬莱市|