使用免費工具WCAT為Web應用程式進行壓力測試

來源:互聯網
上載者:User
原文地址:http://blogs.msdn.com/alikl/archive/2008/03/09/stress-test-asp-net-web-application-with-free-wcat-tool.aspx

步驟:
1.安裝WCAT
2.建立設定檔
3.運行測試
4.檢查結果

安裝WCAT
下載並安裝Internet Information Services (IIS) 6.0 Resource Kit Tools,其中包含WCAT。

建立設定檔
有三個文字檔需要建立和配置:
1.script.txt
此檔案定義了請求,換句話說就是請求哪些頁面和如何請求。下面是一個簡單的script.txt樣本:

NEW TRANSACTION
    classId = 1
    NEW REQUEST HTTP
        Verb = "GET"
        URL = "http:// localhost / BankingShmanking / Default.aspx"

2.distribution.txt
定義了不同請求的權重。例如,我需要我需要在1.aspx上產生2倍於2.aspx的請求,我就會在 此檔案中進行描述。只請求一個頁面的時候,這個檔案是沒什麼作用的。如下是一個distribution.txt檔案的樣本(1代表設定classId為 1的請求,50代表50%的請求被分配到了以此classId為標識的請求上):
1 50
3.config.txt
定義了測試間隔和產生多少用戶端進行請求Web應用程式,下面是一個config.txt檔案的樣本:
Warmuptime 5s
Duration 30s
CooldownTime 5s
NumClientMachines 1
NumClientThreads 20

這些檔案儲存於"C:\Program Files\IIS Resources\WCAT Controller"檔案夾。

運行測試

在命令列模式下,進入到"C:\Program Files\IIS Resources\WCAT Controller"檔案夾,執行如下命令:
wcctl -c config.txt -d distribution.txt -s script.txt -a localhost
再開啟令一個命令列視窗,到C:\Program Files\IIS Resources\WCAT Client檔案夾下,執行命令:
wcclient.exe localhost

檢查結果
結果會直接顯示到螢幕上:


同時在C:\Program Files\IIS Resources\WCAT Controller目錄下組建記錄檔檔案。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.