在过去,我使用微软Web应用程序压力测试工具和Pylot对Web应用程序进行压力测试。我写了一个简单的主页、登录脚本和站点演练(在一个电子商务网站中添加一些商品到购物车和结帐)。

只要让少数开发人员在主页上使劲敲一下,就几乎总能找到一个主要问题。更多的可伸缩性问题将在第二阶段浮出水面,甚至更多——在发布之后。

我使用的工具的URL是Microsoft Homer(又名Microsoft Web Application Stress Tool)和Pylot。

这些工具生成的报告对我来说没有多大意义,我花了很多时间试图弄清楚站点能够支持什么样的并发负载。这总是值得的,因为最愚蠢的错误和瓶颈总是会出现(例如,web服务器配置错误)。

你做了什么,你使用了什么工具,你的方法有什么成功?对我来说,最有趣的部分是提出某种有意义的公式,用于从压力测试应用程序报告的数字中计算应用程序可以支持的并发用户数。


当前回答

我也投票给jMeter,我想在@PeterBernier的回答中添加一些引用。

负载测试回答的主要问题是有多少并发 我的web应用程序可以支持哪些用户?为了得到正确的答案, 负载测试应该代表真实的应用程序使用情况,接近于 可能的。

请记住,jMeter有许多构建块逻辑控制器,配置元素,预处理器,监听器,…这对你有帮助。

你可以模仿真实世界的情况与jMeter,例如,你可以:

Configure jMeter to act as real Browser by configuring (concurrent resource download, browser cache, http headers, setting request time out, cookie management, https support, encoding , ajax support ,... ) Configure jMeter to generate user requests (by defining number of users per second, ramp-up time, scheduling ,...) Configure lots of client with jMeter on them, to do a distributed load test. Process response to find if the server is responding correctly during test. ( For example assert response to find a text in it)

请考虑:

It is easy to start a real web application test with jMeter in minutes. The jMeter has a very easy tool which record your test scenario ( know as HTTP(S) Test Script Recorder). jMeter has lots of plugins at http://jmeter-plugins.org. The jMeter UI is swing based and has made good changes in jMeter 3.2. On the other hand please consider that JMeter GUI should only be used for test and debugging. It is not good practice to use it in GUI mode for actual test. https://www.blazemeter.com/blog/5-ways-launch-jmeter-test-without-using-jmeter-gui. Configure and test your scenario and run it on non-gui mode. The are lots of reporting showing tools in jMeter (Known as listeners) but there are not meant to be on during test. You must run your test and generate reports ( .jtl files). Then you must use these tools to analyze result. Please have a look at https://www.blazemeter.com/blog/jmeter-listeners-part-1-basic-display-formats or https://www.tutorialspoint.com/jmeter/jmeter_listeners.htm.

https://www.blazemeter.com/jmeter提供了非常有用的信息,可以帮助您配置测试环境。

其他回答

看一下TestComplete。

我用过JMeter。除了测试web服务器,您还可以测试数据库后端,消息服务和电子邮件服务器。

我们使用提到的微软工具——微软Web应用程序压力工具。这是我用过的最简单的工具。它在许多方面都受到限制,包括只能在手动创建的测试中命中端口80。但是,它的易用性意味着它确实被使用了。

我们用其他工具(包括OpenSTA和链接检查蜘蛛)来补充这个工具的负载。

从我的初步评估来看,JMeter看起来不错,我希望它能包括在我们未来的持续集成中。但是,JMeter是复杂的,推出起来并不简单。

我建议提出另一个关于解释MS压力工具结果的问题。

我发现IBM Page Detailer也是一个有趣的工具。

冒着被指责为无耻的自我推销的风险,我想指出,在我寻求免费负载测试工具的过程中,我访问了这篇文章:http://www.devcurry.com/2010/07/10-free-tools-to-loadstress-test-your.html

要么我无法获得我想要的吞吐量,要么我无法获得我想要的灵活性。并且我想在测试后分析中轻松地聚合多个负载测试生成主机的结果。

我尝试了清单上的每一种工具,但令我沮丧的是,它们没有一种完全符合我的要求。所以我做了一个,并分享它。

这里是:http://sourceforge.net/projects/loadmonger

PS:熟悉城市俚语的人不会对这个名字做出恶意评论。我以前不是,但现在更世故了。