Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scriptable HTTP benchmark (preferable in Python) [closed]

I'm searching for a good way to stress test a web application. I'm searching for something like ab with a scriptable interface. Ideally, I want to define some tasks, that simulate different actions on the web app (register an account, log in, search, etc.) and the tool runs a whole bunch of processes that execute these tasks*. As a result, I would like something like "average request time", "slowest request (per URI)", etc.

*: To be independent of the client bandwidth I will run these tests from some EC2 instances so that in a perfect world the tool will already support this - otherwise I will script using boto.

like image 275
Martin Thurau Avatar asked May 12 '26 19:05

Martin Thurau


2 Answers

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.

like image 150
Adam Holloway Avatar answered May 14 '26 10:05

Adam Holloway


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.

like image 32
Aliaksandr Belik Avatar answered May 14 '26 09:05

Aliaksandr Belik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!