对 Web 应用程序执行压力测试? [英] Performing a Stress Test on Web Application?

查看:56
本文介绍了对 Web 应用程序执行压力测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In the past, I used Microsoft Web Application Stress Tool and Pylot to stress test web applications. I'd written a simple home page, login script, and site walkthrough (in an ecommerce site adding a few items to a cart and checkout).

与少数开发人员一起努力访问主页几乎总能找到一个主要问题.更多的可扩展性问题会在第二阶段出现,甚至更多 - 在发布之后.

Just hitting the homepage hard with a handful of developers would almost always locate a major problem. More scalability problems would surface at the second stage, and even more - after the launch.

我使用的工具的 URL 是 Microsoft Homer(又名 Microsoft Web 应用程序压力工具)和 Pylot一>.

The URL of the tools I used were Microsoft Homer (aka Microsoft Web Application Stress Tool) and Pylot.

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

The reports generated by these tools never made much sense to me, and I would spend many hours trying to figure out what kind of concurrent load the site would be able to support. It was always worth it because the stupidest bugs and bottlenecks would always come up (for instance, web server misconfigurations).

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

What have you done, what tools have you used, and what success have you had with your approach? The part that is most interesting to me is coming up with some kind of a meaningful formula for calculating the number of concurrent users an app can support from the numbers reported by the stress test application.

推荐答案

这是对 JMeter<的另一个投票/strong>.

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

JMeter is an open-source load testing tool, written in Java. It's capable of testing a number of different server types (for example, web, web services, database, just about anything that uses requests basically).

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

It does however have a steep learning curve once you start getting to complicated tests, but it's well worth it. You can get up and running very quickly, and depending on what sort of stress-testing you want to do, that might be fine.

优点:

  • 来自 Apache 项目的开源/免费工具(有助于购买)
  • 易于上手,一旦掌握了核心概念就易于使用.(即,如何创建请求、如何创建断言、如何使用变量等).
  • 非常具有可扩展性.我已经对 11 台机器进行了测试,在服务器上产生的负载几乎达到每小时一百万次.设置起来比我预期的容易得多.
  • 拥有活跃的社区和良好的资源,可帮助您启动和运行.先阅读教程,玩一会儿.

缺点:

  • 用户界面是用 Swing 编写的.(呃!)
  • JMeter 通过解析服务器返回的响应文本来工作.因此,如果您想验证任何类型的 javascript 行为,那您就不走运了.
  • 非程序员的学习曲线很陡峭.如果您熟悉正则表达式,那么您已经处于领先地位.
  • 支持论坛中有大量(插入咒骂)白痴提出愚蠢的问题,如果他们粗略地浏览一下文档就可以轻松解决这些问题.(我如何使用 JMeter 对我的 Windows GUI 进行压力测试"经常出现).
  • 开箱即用"的报告还有很多不足之处,尤其是对于大型测试.在我上面提到的测试中,我最终不得不编写一个快速的控制台应用程序来执行一些xml-logfile"到html"的转换.不过那是几年前的事了,所以很可能不再需要这样做了.
  • 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.

这篇关于对 Web 应用程序执行压力测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆