可编写脚本的 HTTP 基准测试(最好在 Python 中)

发布于 2025-01-05 12:38:31 字数 1539 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

电影里的梦 2025-01-12 12:38:31

如果您熟悉 python requests 包,那么在 Locust 中编写负载测试非常容易。

http://locust.io/< /a>

我用它来编写我们所有的性能测试。

If you're familiar with the python requests package, locust is very easy to write load tests in.

http://locust.io/

I've used it to write all of our perf tests in it.

草莓酥 2025-01-12 12:38:31

您也许可以查看这些工具:

  1. palb(类似 Python Apache 的基准工具) -具有命令行界面的 HTTP 基准测试工具类似于 ab。
    它缺乏 ab 的高级功能,但它支持多个 URL(来自参数、文件、标准输入和 Python 代码)。

  2. Multi-Mechanize - Python 中的性能测试框架
    Multi-Mechanize 是一个用于性能和负载测试的开源框架。

    • 运行并发 Python 脚本以针对远程站点或服务生成负载(综合事务)。
    • 可用于针对可通过 Python 访问的任何远程 API 生成工作负载。
    • 测试输出报告保存为 HTML 或 JMeter 兼容的 XML。
  3. Pylot(Python 负载测试器) - Web 性能工具
    Pylot 是一个免费的开源工具,用于测试 Web 服务的性能和可扩展性。
    它运行 HTTP 负载测试,这对于容量规划、基准测试、分析和系统调整非常有用。
    Pylot 生成并发负载(HTTP 请求)、验证服务器响应并生成包含指标的报告。
    测试套件通过 GUI 或 shell/控制台执行和监控。

    ( GoogleCode 上的 Pylot )

  4. 研磨机
    默认脚本语言是 Jython。
    非常紧凑操作指南

  5. Tsung
    第一次使用可能有点不寻常,但对于压力测试来说确实很好。
    分步指南.

在上面的回答中为 locust.io +1。

You can maybe look onto these tools:

  1. palb (Python Apache-Like Benchmark Tool) - HTTP benchmark tool with command line interface resembles ab.
    It lacks the advanced features of ab, but it supports multiple URLs (from arguments, files, stdin, and Python code).

  2. Multi-Mechanize - Performance Test Framework in Python
    Multi-Mechanize is an open source framework for performance and load testing.

    • Runs concurrent Python scripts to generate load (synthetic transactions) against a remote site or service.
    • Can be used to generate workload against any remote API accessible from Python.
    • Test output reports are saved as HTML or JMeter-compatible XML.
  3. Pylot (Python Load Tester) - Web Performance Tool
    Pylot is a free open source tool for testing performance and scalability of web services.
    It runs HTTP load tests, which are useful for capacity planning, benchmarking, analysis, and system tuning.
    Pylot generates concurrent load (HTTP Requests), verifies server responses, and produces reports with metrics.
    Tests suites are executed and monitored from a GUI or shell/console.

    ( Pylot on GoogleCode )

  4. The Grinder
    Default script language is Jython.
    Pretty compact how-to guide.

  5. Tsung
    Maybe a bit unusual for the first use but really good for stress-testing.
    Step-by-step guide.

+1 for locust.io in answer above.

只想待在家 2025-01-12 12:38:31

我会推荐 JMeter。

请参阅:http://jmeter.apache.org/

您可以将 JMeter 设置为浏览器的代理来记录操作例如登录然后对您的 Web 应用程序进行压力测试。您还可以为其编写脚本。

I would recommend JMeter.

See: http://jmeter.apache.org/

You can setup JMeter as proxy of your browser to record actions like login and then stress test your web application. You can also write scripts to it.

心清如水 2025-01-12 12:38:31

不要忘记FunkLoad,它非常容易使用

Don't forget FunkLoad, it's very easy to use

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文