2014-12-04 158 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. 

我希望有些混乱,现在是明确的:)