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

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

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

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

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


当前回答

Visual Studio测试版2010(2008年也不错)。这是一个非常简单和强大的工具来创建web/负载测试。

在Windows服务器上使用此工具的好处是,您可以在报告中集成访问所有perfmon服务器统计信息。真的有用。

另一个好处是,在Visual Studio项目中,你可以集成一个“性能会话”来分析你网站的代码执行情况。

如果你在windows服务器上提供网页服务,这是最好的工具。

然而,使用多台机器来加载测试应用程序需要一个单独且昂贵的许可证。

其他回答

我用过openSTA。

这允许与网站的会话被记录,然后通过相对简单的脚本语言回放。

您可以轻松地测试web服务并编写自己的脚本。

它允许您以任何您想要的方式将脚本放在一个测试中,并配置迭代的数量、每次迭代中的用户数量、引入每个新用户的递增时间以及每次迭代之间的延迟。将来还可以安排测试。

它是开源的,免费的。

它生成了许多报告,这些报告可以保存到电子表格中。然后,我们使用数据透视表来方便地分析和绘制结果。

另外,对于我们的web应用程序,我发现由于线程之间的锁争用导致了巨大的性能问题……所以这个教训就是要仔细考虑锁定方案。我们最终让工作线程使用异步http处理程序来抑制太多的请求,否则应用程序就会不堪重负,崩溃并烧毁。这意味着大量的积压工作可能会堆积起来,但至少网站会继续运行。

这是给JMeter的另一票。

JMeter是一个开源的负载测试工具,用Java编写。它能够测试许多不同的服务器类型(例如,web, web服务,数据库,基本上使用请求的任何东西)。

然而,一旦你开始面对复杂的测试,它确实有一个陡峭的学习曲线,但它是非常值得的。您可以非常快速地启动并运行,这取决于您想要进行哪种类型的压力测试,这可能没问题。

优点:

Open-Source/Free tool from the Apache project (helps with buy-in) Easy to get started with, and easy to use once you grasp the core concepts. (Ie, how to create a request, how to create an assertion, how to work with variables etc). Very scalable. I've run tests with 11 machines generating load on the server to the tune of almost a million hits/hour. It was much easier to setup than I was expecting. Has an active community and good resources to help you get up and running. Read the tutorials first and play with it for a while.

缺点:

The UI is written in Swing. (ugh!) JMeter works by parsing the response text returned by the server. So if you're looking to validate any sort of javascript behaviours, you're out of luck. Learning curve is steep for non-programmers. If you're familiar with regular expressions, you're already ahead of the game. There are large numbers of (insert expletive) idiots in the support forum asking stupid questions that could be easily solved if they'd give the documentation even a cursory glance. ('How do I use JMeter to stress-test my Windows GUI' shows up quite frequently). Reporting 'out of the box' leaves much to be desired, particularly for larger tests. In the test I mentioned above, I ended up having to write a quick console app to do some of the 'xml-logfile' to 'html' conversions. That was a few years ago though, so it's probable that this would no longer be required.

我们最近开始使用Gatling进行负载测试。我强烈推荐使用这个工具进行负载测试。我们过去使用过SOASTA和JMETER。我们考虑加特林的主要原因如下:

记录仪对场景进行记录 使用Akka和Netty相比性能更好 Jmeter线程模型 DSL Scala相比Jmeter XML更易于维护 编写测试很容易,如果是scala也不用害怕。 报告

让我给你一个简单的例子来写代码使用加特林代码:

// your code starts here  
val scn = scenario("Scenario")  
     .exec(http("Page")
     .get("http://example.com")) 
// injecting 100 user enter code here's on above scenario.   
setUp(scn.inject(atOnceUsers(100)))       

但是你可以让它越复杂越好。加特林的突出特点之一是报告非常详细。

以下是一些链接: 加特林 加特林教程

我最近做了一个关于它的演讲,你可以在这里看一下: https://docs.google.com/viewer?url=http%3A%2F%2Ffiles.meetup.com%2F3872152%2FExploring-Load-Testing-with-Gatling.pdf

You asked this question almost a year ago and I don't know if you still are looking for another way of benchmarking your website. However since this question is still not marked as solved I would like to suggest the free webservice LoadImpact (btw. not affiliated). Just got this link via twitter and would like to share this find. They create a reasonable good overview and for a few bucks more you get the "full impact mode". This probably sounds strange, but good luck pushing and braking your service :)