对网站进行压力测试的最佳方法 [英] Best way to stress test a website

查看:63
本文介绍了对网站进行压力测试的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个错误的问题,但是,在 asp.net Web 应用程序上复制大量负载的最佳方法是什么?有没有一种简单的方法来模拟特定页面上的许多请求?或者最好使用分析器来跟踪单个请求,然后在性能正常的情况下从中计算出来?

This may be the wrong question to ask but, what's the best way to replicate a large load on an asp.net web application? Is there an easy way to simulate many requests on particular pages? Or is the best thing to use a profiler to track a single request and then work out from that if the performance is ok?

了解 Web 应用程序与服务器规范的配合情况会很好.我希望能够在我的测试服务器上模拟大量流量,以便我可以确定生产服务器是否足够好(特别是 iis/asp.net 而不是 db 性能).

It would be good to know how well a web app works with a server spec. I'd like to be able to simulate heavy traffic on my testing server so that I can work out if the production server is good enough (specifically with iis/asp.net not db performance).

推荐答案

我的建议是你先做一些自动化测试.使用 selenium.

My suggestion is for you to do some automated tests first. Use selenium for it.

然后部署 selenium grid 以在多台计算机上同时进行测试.

Then deploy selenium grid to test in multiple computers at the same time.

虽然作为自动化测试工具的 Selenium 运行速度非常快,但可以进行小型压力测试.如果您在网络上的几台计算机上同时运行相同的自动化,您将能够看到它的行为.

Although Selenium as an automated test tool will run quite fast, making a mini stress test. If you put the same automation running on a couple of computers on your network at the same time you'll be able to see how it behaves.

如果你想记录响应时间,他们有一个很酷的 api,你可以用它来编写一些脚本来运行你的自动化.

If you want to record response timings, they have a cool api you can use to write some scripts to run your automations.

Selenium 非常易于使用,如果您想测试内容,它会断言页面内容.如果您愿意(这将是我的建议),它还会复制您在页面上的移动,只需经常浏览页面,然后将其保存以进行自动化.避免放置断言,这样 selenium 可能会运行得更快.

Selenium is quite easy to use, and it does asserts to page contents if you want to test the contents. It also copies your movement through the page if you wish (this would be my suggestion) just navigate the page a lot, and then save it for automation. Avoid putting asserts so selenium might run faster.

这篇关于对网站进行压力测试的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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