如何对我们的网站进行性能测试
我们的客户需要我们模拟50人同时在网站上工作,并且响应时间应该在5秒之内。 但我们担心的是,如果我们在他们的网站上测试,我们无法控制网络速度、硬件等。因为这可能会影响我们的测试结果。 还有就是我们的网站里有一些antiforgerytoken,性能测试工具无法模拟这种机制,当我们记录请求后,系统再次发送时,就会失败,因为token已经失效了。 我想知道你们通常如何进行这个性能测试? 有什么建议吗? 提前致谢 !
and our client need we to simulate 50 person to work at the same time on the website, and the response time should be within 5 seconds.
But our concern is that if we test at their website, we can not control the network speed, hardware and so on. As that might effect our test result.
and another thing is there are some antiforgerytoken in our website, the performance test tool can not simulate this mechanism, after we record the request, and system send it again, it will fail, since the token is invalidated.
and I want to know how do you perform this performance test usually ?
any suggestions ?
Thanks in advance !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通常的方法是分阶段进行。
首先,使用 WCAT 等简单工具在开发环境中进行测试。它不会运行 JavaScript 或进行回发,但会强调同时请求和线程,这通常是主要的性能瓶颈。
一旦按预期工作,即可升级到 Visual Studio Team Test,它支持更复杂的场景。从实验室开始,然后转移到测试/预生产环境。除了客户端测量之外,或者有时代替客户端测量,我还喜欢使用服务器端性能计数器和监控。
对于防伪逻辑,仅出于负载测试目的,您可以构建没有该检查的系统版本。
接下来,在测试环境中与真实用户进行测试。详细信息取决于项目。如果我无法获得真正的用户,我还会使用数十台 PC 创建设置,并使用真实的浏览器运行测试脚本。有一些很好的第三方工具也可以在这里提供帮助,例如 Load Runner(尽管价格昂贵)。
最后,软件投入生产后继续监控和测试。在测试版中运行良好的软件在生产中由于某些不可预见的差异或不一致(例如 IIS 配置)而崩溃的情况并不少见。
My usual approach is phased.
First, test in the development environment using a simple tool like WCAT. It won't run JavaScript or do postbacks, but it will stress simultaneous requests and threads, which are often major performance bottlenecks.
Once that's working as desired, then move up to Visual Studio Team Test, which supports more complex scenarios. Start in the lab, and then move to a beta / pre-production environment. I also like to use server-side performance counters and monitoring, in addition to or sometimes instead of client-side measurement.
For the anti-forgery logic, for load testing purposes only you might build a version of the system that doesn't have that check.
Next, test with real users in a beta environment. The details depend on the project. If I can't get real users, I've also created setups with tens of PCs running test scripts with real browsers. There are some good third-party tools that can help here, too, such as Load Runner (expensive, though).
Finally, continue to monitor and test once the software goes into production. It's not uncommon for software that works great in beta to fall apart in production due to some unforeseen difference or inconsistency (IIS config, for example).
运行负载测试时,最好尽可能地模拟您的环境。如果测试系统的资源与生产系统的资源不同,您必然会得到不同的结果。
尽管如此,您仍然可以使用给定的硬件运行测试并报告您获得的数字。例如,无论生产系统有多少可用带宽,您都可以知道系统需要多少带宽,因为这是可以测量的。
但如果您想根据客户将看到的内容进行衡量,则必须在相同的环境中进行。
When running load tests, it is really best to emulate your environment as best as possible. If the resources of the test system are different than the production system, you are bound to get different results.
Still, you can run tests with given hardware and report on the numbers you get. For instance, you can know how much bandwidth your system needs regardless of how much the production system has available because that can be measured.
But if you want to measure against what the client will see, you have to do it with the same environment.