简体   繁体   English

Python中的网站压力测试 - Django

[英]Website stress test in Python - Django

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. 问题是我不知道如何实现它,因为它需要调用并行的url请求。 Any ideas? 有任何想法吗?

Also, there is an awesome open-source pure-python distributed and scaleable locust framework that uses greenlets . 此外,还有一个使用greenlet的真棒开源pure-python分布式和可扩展的蝗虫框架。 It's great at simulating enormous amount of simultaneous users. 它非常适合模拟大量的并发用户。

Why build it? 为什么要建造它?

There are several available. 有几个可用。

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

如果你想留在Python框架内,你可以尝试Corey Goldberg的Pylot或其后继多机械化

Although this question is quite old, I'd like to point out a nifty tool about this problem. 虽然这个问题很老,但我想指出一个关于这个问题的漂亮工具。 The tool is funkload . 这个工具很有趣

I'm not sure if this exactly the type of testing you were looking for but BrowserMob uses Selenium to do browser load testing. 我不确定这是否是您正在寻找的测试类型,但BrowserMob使用Selenium进行浏览器负载测试。 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. 它不是为任何特定框架创建的,应该适用于几乎任何Web应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM