TShopping

 找回密碼
 註冊
搜索
查看: 2852|回復: 3
打印 上一主題 下一主題

[CentOS] Apache 專用的壓力測試工具 -- ab

[複製鏈接]
跳轉到指定樓層
1#
發表於 2008-5-30 17:52:57 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
 
Push to Facebook
在阿帕契服務器的套件中,有一個叫做 ab (ApacheBench) 的工具。ApacheBench 主要是用來測試阿帕契服務器執行效率用的,我們就以 ApacheBench 做為 CGI vs. FastCGI 的評比工具。

ApacheBench 可以針對某個特定的 URL 仿真出連續的聯機請求,同時還可以仿真出同時間點數個相同的聯機請求,因此利用 ApacheBench 可幫助我們在網站開發期間仿真實際上線可能的情況,利用仿真出來的數據做為調整服務器設定或程序的依據。 ApacheBench 的用法如下:

Usage: /usr/local/apache/bin/ab [options] [http://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make
-t timelimit Seconds to max. wait for responses
-p postfile File containg data to POST
-T content-type Content-type header for POSTing
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-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
-V Print version number and exit
-k Use HTTP KeepAlive feature
-h Display usage information (this message)

ab使用:
要執行 1000 次的 connection, 20 次的 concurrent (並行, 同時).
語法: ab -n 1000 -c 20 http://localhost/abc.php
產生出來的結果. 主要要注意的是以下幾個.
Time taken for tests: 總共執行花了多久的時間.(以上 1000 次共多久)
Requests per second: 每秒平均可以處理多少個 connection.

 

臉書網友討論
2#
發表於 2013-11-8 01:10:16 | 只看該作者
你加油吧  

版主招募中

*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-4-27 00:59 , Processed in 0.061866 second(s), 17 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表