1

我有RoR 2.1和後端MySQL一個Web應用程序並與周圍8K用戶運行,現在我想做一個Load Test我的web應用程序和服務器,以找出load on the server and the average and peak number of concurrent users.執行的回報率2.1 Web應用程序和服務器

負載測試

實施此負載測試的方法是什麼,以分析服務器上的負載和Web應用程序的性能,並找出併發用戶的平均數和峯值數?

回答

2

我使用ab(apache基準測試http://httpd.apache.org/docs/2.0/programs/ab.html)進行負載測試。測試在google.com例如:

ab -n 10000 -c 100 http://google.com/ 

它可以讓我調查每秒多少請求我的設置(應用程序)可以這樣做,以及併發級別。

ab工具是CentOS和Red Hat發行版中的Apache httpd軟件包的一部分。所以它可能已經安裝在那裏。對於Ubuntu/Debian安裝apache2-utils軟件包。

ab --help for full options list 

最重要的是:

-n requests  Number of requests to perform 
-c concurrency Number of multiple requests to make 

而且我正在監控與穆寧活動高峯(http://httpd.apache.org/docs/2.0/programs/ab.html)以及針對nginx /乘客/獨角獸/ CPU /內存的插件(取決於配置),以及針對MySQL的插件,其中顯示了每秒查詢總量以及更多數據。

您可以從該頁面http://munin-monitoring.org/wiki/LinuxInstallation使用RH linux的相應教程安裝munin。

這裏也即將穆寧和雜種監控相當不錯的文章: http://onrails.org/2007/08/31/monitoring-rails-performance-with-munin-and-a-mongrel

你可以拿起阿帕奇(而不是隻)從http://exchange.munin-monitoring.org監控插件。

好處在於它不需要更改應用程序。所以你可以安裝它並使用而不需要你的生產設置的任何改變。

+0

非常感謝您能夠向我提供有關安裝和使用步驟的文檔。另外,我將如何獲取有關「併發用戶的平均數和峯值數」的細節? – 2011-12-30 09:05:31

+0

也是我的應用程序的服務器不是Apache它的Mongrel – 2011-12-30 09:06:15

+0

你在服務器上有什麼操作系統? – 2011-12-30 09:14:52

相關問題