2014-12-04 155 views
0

我一直在給定負載的測試軟件我的團隊設計和製造任務尋找幫助。它是一個Java Web應用程序,它充當我公司所有其他應用程序的API。在設計負載測試

這是系統的一個大致的輪廓:

1) Application 1 needs information from the database. 

2) App 1 produces a request to a rabbit exchange (routing key for the queue that is consumed by the tool I'm testing). 

3) My tool consumes the RabbitMQ queue that App1 pushed to 

4) My tool executes the request sent from App1 via the Rabbit queue 

5) My tool then sends the response back to App 1 via a Rabbit Exchange/Reply Queue. 

6) App 1 then consumes from the reply queue and handles the response 

這是一個非常低的水平視圖,也有很多被髮布到和消費隊列中的每個應用程序的實例。

我從來沒有負荷測試,任何事情之前,所以我是新來的可用的概念和工具。

現在我使用JMeter的啓動電話和消費的答覆(而且我已經在示例的操作,就像應用程序1,它通過調用兔肉和消費的回覆)。

這裏是我的問題:

1) Is this a viable way to load test? Should I be testing the capacity of the server directly or should I continue going through rabbit since it's a closer to production use case? 

2) What is the best way to adjust my rate of production? I've tried doing some throttling via jMeter but when I look at the rabbit graphs the publish rate seems to fluctuate wildly. Example: I tell jMeter to publish at 1000 messages/sec and the graph on the rabbit dashboard goes from 500/sec to 3000/sec. I don't feel like I can accurately get an idea of what we can handle if I can reliably adjust the rate. 

我的計劃是:

1) Find the rate at which my application can't pick things off the queue fast enough. (where the rate of publishing to the queue becomes faster than my application can consume them). 

2) Once I know the fastest I can send stuff to the queue I can check the responses for error rate and processing time. 

我在想,通過這樣做,我可以找出最大的速度,我們可以發佈到隊列中,同時還在可接受的錯誤率範圍內以及關於週轉時間將會變化的想法。

還有什麼我應該尋找?爲了在這方面取得成功,我應該瞭解負載測試的任何「規則」?

謝謝!

+1

負載測試是複雜的,不容易在解剖評論(但沒有時間更長的回答)。有一點需要記住,你需要明確你想要展示的目標。您是否試圖查看服務器是否可以處理特定的負載(即3000次/秒)或最大值?加載服務器可以處理?如果你瞄準一個目標,但是測試別的東西,你得到的結果將不會讓你得出結論(根據收集的數據) – ochi 2014-12-04 00:09:49

回答

2

在我看來,你應該考慮以下幾點,

  1. 對於任何複雜的系統(包括多個組件)的負載測試,劃分負載測試按組件(應用,兔隊列,生產者,消費者)。這背後

    原因是一個測試你不能在系統中的瓶頸,否則會導致不正確的結果。

  2. 在我的團隊,我們曾經有過這樣的分配(發行商 - 消費者模式)一次。有沒有規則說負載測試您必須使用任何負載測試工具。可以充當負載生成器(Publisher)的簡單Java代碼和消耗負載(Consumer)的簡單Java代碼將足以進行負載測試。

  3. JMeter是一個不錯的選擇(免費,可擴展的,可靠的,在行業已知的),但你可以檢查LoadRunner的,Neoload等

恕我直言,你應該獨立的組件和單獨測試它們這將幫助您找到答案,例如最高消費率和最高出版商費率。一個簡單的java代碼可以爲你做到這一點。你不需要JMeter的請求。這樣您就可以更好地控制生產率和消費率。

是的你的計劃是正確的,找到最大。評估發行商和消費者可以給予您的最大可能利率。系統吞吐量。在做這件事時,也要注意系統利用率。

最後,當你獲得穩定的系統的測量,你可以去2種選擇,

1. Stress test (when system breaks) 
2. Tune the system to improve the performance and repeat the cycle for new measurements. 

我希望有些混亂,現在是明確的:)