Application Center Test 在測試運行中自動監視 HTTP 性能統計信息,但性能計數器必須在測試運行之前明確進行配置。
請檢查 ACTTrace.log 文件和報告,並確保不存在以下錯誤:
腳本錯誤
DNS 錯誤
套接字連接錯誤
HTTP 錯誤
如有必要,請在重新運行測試之前改正其中的錯誤。
dcomcnfg.exe 啓動 DCOM 配置工具
計算頁面性能的公式
以下公式通過測量每個請求所需的處理器週期數來量化 Web 應用程序的性能。該公式用所消耗的週期數除以所處理的請求數。
(sum of processor speed x processor use)
________________________________________ = cost, in cycles/request (or Hz/rps)
number of requests per second
例如,在應力測試中,ASP 頁面的最大容量可達每秒 800 個請求,同時 Web 服務器的處理器使用率爲 85%。如果 Web 服務器的處理器頻率爲 700 MHz(每秒 700,000,000 週期),可以使用以下公式來計算頁面的成本:
((4 x 700 000 000 cycles/s) x 0.85)
___________________________________ = 2 975 000 cycles/request
800 requests/s
計算頁面性能的 VBScript 代碼
使用以下 VBScript 函數計算成本:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function to return the cost of a page, based on
' stress test values and Web server/cluster hardware.
'
' Returns: page cost, in millions of cycles per request
'
Function GetPageCost(iSumOfProcessorSpeeds, _
fAverageProcessorUse, iAverageRPS)
Dim iSpentCyclesPerSecond
' calculate the number of cycles used over the testing period
iSpentCyclesPerSecond = iSumOfProcessorSpeeds _
* fAverageProcessorUse
' calculate the amount of work performed by the Web server
If (iAverageRPS > 0) Then
GetPageCost = iSpentCyclesPerSecond / iAverageRPS
Else
GetPageCost = 0
End If
End Function
使用頁面成本的示例
瞭解頁面成本有許多用途。
最顯而易見的用途是比較兩個不同頁面的性能,或者比較同一頁面在調整前後的成本。
特別是當測試對站點中的所有頁面進行請求時,可以通過成本初步估計是否需要隨着要處理的通信量的增加、CPU 使用率的更改(或者同時處理兩者)添加附加硬件。
在前面的示例中,需要多大的處理器速度才能保證處理兩倍的站點通信量,同時使處理器的使用率保持在 40% 左右,以便可以輕鬆處理至少達到 3200 rp 的臨時負載增長?
以下計算表明需要的處理器速度大約爲 11900 MHz:
page cost x target RPS
estimated processor speed = ______________________
processor use
2 975 000 cycles/request x 1600 requests/s
estimated processor speed = __________________________________________
0.40
estimated processor speed = 11 900 000 000 cycles/s
number of 700 MHz processors needed = 11 900 MHz / 700 MHz = 17
新的性能目標要求 Web 服務器羣集中有大約 17 個處理器,而原來只需 4 個。再次強調,這些估計僅當處理器速度是限制 Web 應用程序性能的因素時纔有意義。