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

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

问题描述

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

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.我建议使用一些来自

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:

  • My boss wants me to load test our web app!
  • JMeter Wiki

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

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

  • Load Testing your Applications with Apache JMeter
  • Using JMeter
  • Effective load testing with Apache JMeter
  • Load Testing with JMeter: part 1, part 2, part 3
  • A Simple Load Test with JMeter
  • Load Testing with Apache JMeter
    Performance testing with JMeter
  • Your First JMeter Test
  • Some thoughts on stress testing web applications with JMeter: part 1, part 2.

UPD.
请查找,使用并随时扩展此
JMeter资源集合在github上继续进行.

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

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

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