python Python中的网站压力测试 - Django

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2604747/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-04 01:02:39  来源:igfitidea点击:

Website stress test in Python - Django

pythondjangohttptestingload

提问by RadiantHex

I'm trying to build a small stress test script to test how quickly a set of requests gets done.

我正在尝试构建一个小的压力测试脚本来测试一组请求的完成速度。

Need to measure speed for 100 requests.

需要测量 100 个请求的速度。

Problem is that I wouldn't know how to implement it, as it would require parallel url requests to be called. Any ideas?

问题是我不知道如何实现它,因为它需要调用并行 url 请求。有任何想法吗?

采纳答案by Wolph

Why build it?

为什么要建造它?

There are several available.

有几种可用。

  1. For a single url and many requests try ab
  2. For multiple urls and random tests try siege
  1. 对于单个 url 和许多请求,请尝试ab
  2. 对于多个 url 和随机测试,请尝试siege

回答by alecxe

Also, there is an awesome open-source pure-python distributed and scaleable locustframework that uses greenlets. It's great at simulating enormous amount of simultaneous users.

此外,还有一个很棒的开源纯 Python 分布式和可扩展的locust框架,它使用greenlets。它非常适合模拟大量同时使用的用户。

回答by cpt_ahag

If you want to stay within the Python framework you might try Corey Goldberg's Pylotor its successor multi-mechanize.

如果您想留在 Python 框架内,您可以尝试 Corey Goldberg 的Pylot或其继承者multi-mechanize

回答by Luca Invernizzi

Although this question is quite old, I'd like to point out a nifty tool about this problem. The tool is funkload.

虽然这个问题已经很老了,但我想指出一个关于这个问题的漂亮工具。该工具是funkload

回答by Jeremy B.

I'm not sure if this exactly the type of testing you were looking for but BrowserMobuses Seleniumto do browser load testing. It works as if many browsers were pounding on your site simultaneously. It isn't created for any specific framework and should work on pretty much any web app.

我不确定这是否正是您正在寻找的测试类型,但BrowserMob使用Selenium进行浏览器负载测试。它的工作原理就像许多浏览器同时冲击您的网站一样。它不是为任何特定框架创建的,应该适用于几乎所有网络应用程序。