Skip to content

Descent098/floodr

 
 

Repository files navigation

floodr

Floodr is a HTTP load testing system designed to be lightweight, fast, and highly configurable

Documentation site

What and Why?

Floodr is meant to help generate a bunch of HTTP requests via a configuration file to help test and/or benchmark a web server. It's used to test performance, and failure characteristics for when and how a server slows down and/or dies. It has several use cases including:

  • Determining limits of how many requests you can handle simultaneously
  • Understanding performance degredation as load increases on your server
  • Testing changes between versions
    • Complex flows still work (i.e. logging in, getting a token, then accessing an API)
    • No performance degredations with new features
  • Help diagnose potential race conditions by firing many simultaneous events
  • Gethering statistics at various percentiles to help debug weird performance issues

Keep in mind you should only run floodr against your own systems (and not on production systems), in many places running this can be considered a DOS attack and might be illegal without permission

Demo

asciicast

Features

This is the list of all features supported by the current version of floodr:

Installation

You have 3 options for install, as a binary, or via cargo from crates.io, or from source.

Binary Install

The easiest way to get floodr is to download a pre-built binary from the latest release page.

Cargo Install Options

If you have Rust available on your machine you can install with cargo directly from crates.io using:

cargo install floodr

or you can build it from source:

git clone https://github.com/descent098/floodr
cd floodr
cargo install --path . 

Basic Usage

Floodr uses benchmark files (YAML files) to plan runs. The simplest plan is a single request to a set URL:

benchmark.yml

base: http://localhost:4896 # The domain to run queries against

plan: # The actions to run
- name: Fetch
  request:
    url: /

You can then run using floodr or with more details by running floodr --stats:

$> floodr --stats
Concurrency 1
Iterations 1
Rampup 0
Base URL http://localhost:4896

Fetch                     http://localhost:4896/ 200 OK 309ms

Fetch                     Total requests            1
Fetch                     Successful requests       1
Fetch                     Failed requests           0
Fetch                     Median time per request   309ms
Fetch                     Average time per request  308ms
Fetch                     Sample standard deviation 0ms
Fetch                     99.0'th percentile        309ms
Fetch                     99.5'th percentile        309ms
Fetch                     99.9'th percentile        309ms

Time taken for tests      0.3 seconds
Total requests            1
Successful requests       1
Failed requests           0
Requests per second       3.23 [#/sec]
Median time per request   309ms
Average time per request  308ms
Sample standard deviation 0ms
99.0'th percentile        309ms
99.5'th percentile        309ms
99.9'th percentile        309ms

We can then begin increasing the load by adding more concurrency an iterations:

benchmark.yml

base: http://localhost:4896 # The domain to run queries against
concurrency: 10 # How many threads to run
iterations: 2000 # Total number of times to run the plan

plan: # The actions to run
- name: Fetch
  request:
    url: /

We can run with --quiet and --stats to just see the overall results:

$>floodr --quiet --stats
Concurrency 10
Iterations 2000
Rampup 0
Base URL http://localhost:4896


Fetch                     Total requests            2000
Fetch                     Successful requests       2000
Fetch                     Failed requests           0
Fetch                     Median time per request   0ms
Fetch                     Average time per request  2ms
Fetch                     Sample standard deviation 23ms
Fetch                     99.0'th percentile        0ms
Fetch                     99.5'th percentile        1ms
Fetch                     99.9'th percentile        324ms

Time taken for tests      0.4 seconds
Total requests            2000
Successful requests       2000
Failed requests           0
Requests per second       5281.91 [#/sec]
Median time per request   0ms
Average time per request  2ms
Sample standard deviation 23ms
99.0'th percentile        0ms
99.5'th percentile        1ms
99.9'th percentile        324ms

Roadmap

  • Be able to run benchmarks for a set amount of time instead of iterations
  • Cli options for quick tests without a dedicated benchmark plan
  • TUI for interactive sessions
  • Allow reports for PDF's with charts
  • Web interface for interactive sessions
  • improve the API for easier library usage
  • Improve code coverage

FAQ

Can I use this without any extra files? No, currently you need a benchmark plan (YAML file), but in the future there are plans for a CLI where you will just be able to specify a route and hit it as hard as you can
Can I run a test for a set amount of time?

No, calculating how long a plan runs for currently is also quite complicated, so there are plans in the future to make it possible to just run a test with a set concurrency and route to hit

Why the name change?

This project is a fork of drill, which was a fantastic base to build from. Unfortunately the name drill is already taken both on crates.io, and conflicts with a few other tools as mentioned in other issues like this one, and this in the original project. No one seemed to be using floodr so I grabbed it!

What about Drill?

This project is a fork of drill, which was a fantastic base to build from. I originally was hoping of creating a compatible version and just contributing to the original project.

Unfortunately, due to questions around maintainer status I tentatively started a fork, and was intending to contribute upstream. As time went on I wanted more breaking changes. At this point while the core is largely the same, I changed a lot, and intend to change a lot more. I have limited time to work on side projects these days, so I just do work when I can, and while I have motivation. Likewise a lot of pretty major bugs were left unsolved in the original (no shade to the original dev, everyone gets busy), and I need something like this for work, so hard fork it is.

This project is a fork of Drill (2017-present). Forked under the terms of the GLPV3.

The original project is still great, and worth a look. If you're feeling generous I would give the original dev a donation(I did), they did great work:

"Buy Them A Coffee"

About

a HTTP load testing system designed to be lightweight, fast, and highly configurable

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 98.1%
  • JavaScript 1.6%
  • Other 0.3%