如何使用 JMeter 对网站进行负载测试 [英] How to perform load testing for website using JMeter

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

问题描述

我想在 JMeter 中创建一个脚本来模拟例如100 位用户在 3-4 分钟内访问我们的网站.

I want to create a script in JMeter that simulates e.g. 100 users accessing our site over a period of 3-4 minutes.

我们需要测试我们的应用程序是否可以允许 25.000 个用户/天 - 即每小时 1.100 个.

We need to test whether our application can allow 25.000 users/day - that is 1.100 per hour.

为此,我做了这个 Jmeter 测试:

For that i have made this Jmeter test:

这是结果

这是图表

我想知道这个结果到底告诉我们什么,如果我的测试通过或失败,yahoo.com(我们已经为我们的例子运行了这个测试)是否可以允许 25.000 个用户/天,如果我输入我的标准/要求正确吗?

I want to know what this result is exactly telling us, if my test pass or fails, if yahoo.com (for which we have run this test for our example) can allow 25.000 users/day and if i am inputting my criteria / requirements correctly?

谢谢

推荐答案

1. 我建议使用更好的一些来自 jmeter-plugins 代替:

1. I would advise to use better some custom samplers from jmeter-plugins instead:

  • Ultimate Thread Group: more flexible implementation of Thread Group allows to setup your load-testing scenario exactly how you want;
  • Response Times Over Time / Response Times vs Threads / Active Threads Over Time listeners: more demonstrative graphs as JMeter's default ones.

2. 除了上面的@Qwe 评论:测试不是单个 HTTP 请求而是用户的事务:每个测试线程应该模拟一种真实用户的浏览活动:登录(如果有的话))、浏览网站、搜索、访问/编辑个人设置、注销等
要模拟真实用户,还要在事务步骤之间添加思考时间"计时器.

2. In addition to the @Qwe comment above: test not the single HTTP request but user's transactions: each test-thread should simulate a kind of real-user browsing activity: login (if any), navigating through the site, search, accessing/editing personal settings, logout, etc.
To emulate real-user add also "think-time" timer between transaction steps.

3. 控制响应,至少如下:

3. Control responses, at least the following:

  • response code of each user's request (@ Response Assertion);
  • duration - to verify non-functional requirements for critical transactions (@ Duration Assertion).

4. 查看相应的 JMeter 文档:

4. Look into corresponding JMeter documentation:

5. 您可以在此处找到有关 Jmeter 设置和负载测试使用的一些分步指南:

5. Some step-by-step guidelines about Jmeter setup and usage for load-testing you can find here:

UPD.
请查找、使用并随意扩展这个 Awesome JMeter 合集,在 github 上继续.

UPD.
Please find, use and feel free to extend this Awesome JMeter collection continued on github.

这篇关于如何使用 JMeter 对网站进行负载测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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