Convert Figma logo to code with AI

codesenberg logobombardier

Fast cross-platform HTTP benchmarking tool written in Go

5,635
311
5,635
22

Top Related Projects

17,902

HTTP load generator, ApacheBench (ab) replacement

23,314

HTTP load testing tool and library. It's over 9000!

37,575

Modern HTTP benchmarking tool

24,523

Write scalable load tests in plain Python 🚗💨

1,884

Goad is an AWS Lambda powered, highly distributed, load testing tool

3,311

Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.

Quick Overview

Bombardier is a high-performance HTTP(S) benchmarking tool written in Go. It's designed to stress test web servers and APIs by generating a large number of concurrent requests. Bombardier offers various customization options and provides detailed statistics about the benchmarking process.

Pros

  • Fast and efficient, capable of generating high loads with minimal resource usage
  • Supports both HTTP and HTTPS protocols
  • Offers detailed statistics and customizable output formats
  • Cross-platform compatibility (Windows, macOS, Linux)

Cons

  • Limited documentation for advanced usage scenarios
  • Lacks some features found in more comprehensive benchmarking tools
  • May require additional setup for complex testing scenarios

Getting Started

To use Bombardier, follow these steps:

  1. Download the latest release from the GitHub repository.
  2. Extract the executable to a directory in your PATH.
  3. Run a basic benchmark:
bombardier -c 100 -n 10000 http://example.com

This command will send 10,000 requests to http://example.com using 100 concurrent connections.

For more advanced usage, you can customize various parameters:

bombardier -c 200 -d 30s -l http://api.example.com/endpoint

This command will run a 30-second benchmark with 200 concurrent connections and log the results.

To test with a specific HTTP method and headers:

bombardier -m POST -H "Content-Type: application/json" -b '{"key": "value"}' http://api.example.com/post

This command sends POST requests with a JSON payload and a custom header.

For detailed usage instructions and options, refer to the project's README on GitHub.

Competitor Comparisons

17,902

HTTP load generator, ApacheBench (ab) replacement

Pros of hey

  • Written in Go, offering good performance and cross-platform compatibility
  • Simple and straightforward CLI interface
  • Supports HTTP/2 by default

Cons of hey

  • Limited customization options compared to bombardier
  • Lacks some advanced features like custom headers and request body

Code comparison

hey:

func (b *Work) Run() {
    b.results = make(chan *result, b.N)
    if b.Output == "" {
        b.bar = newPb(b.N)
    }
    b.run()
}

bombardier:

func (b *Bombardier) fire() {
    b.barrier.Wait()
    b.ratelimiter.Wait()
    b.client.Do(b.req)
    b.recordResult()
}

Both tools use Go's concurrency features to manage multiple requests, but bombardier offers more fine-grained control over the benchmarking process.

hey is simpler to use and supports HTTP/2 out of the box, making it a good choice for quick benchmarks. bombardier provides more advanced features and customization options, making it suitable for more complex testing scenarios.

Overall, hey is ideal for simple, quick benchmarks, while bombardier is better suited for more detailed and customizable load testing.

23,314

HTTP load testing tool and library. It's over 9000!

Pros of Vegeta

  • More extensive reporting options, including real-time metrics and detailed histograms
  • Supports multiple output formats (JSON, CSV, Histogram) for better integration with other tools
  • Offers a library mode, allowing integration into Go applications for programmatic load testing

Cons of Vegeta

  • Less intuitive command-line interface compared to Bombardier
  • Lacks built-in support for WebSocket connections
  • May require more setup time for complex scenarios

Code Comparison

Vegeta:

rate := vegeta.Rate{Freq: 100, Per: time.Second}
duration := 5 * time.Second
targeter := vegeta.NewStaticTargeter(vegeta.Target{
    Method: "GET",
    URL:    "http://example.com",
})
attacker := vegeta.NewAttacker()

Bombardier:

b, err := bombardier.New(&bombardier.Config{
    NumReqs:    &numReqs,
    URL:        url,
    Method:     "GET",
    Timeout:    defaultTimeout,
    Headers:    headers,
    BodyReader: bodyReader,
})

Both tools are powerful HTTP load testing utilities, but Vegeta offers more advanced reporting and integration options, while Bombardier provides a simpler interface and built-in WebSocket support. Choose based on your specific requirements and familiarity with Go.

37,575

Modern HTTP benchmarking tool

Pros of wrk

  • Written in C, potentially offering better performance for certain workloads
  • Supports Lua scripting for more complex benchmarking scenarios
  • Has a longer history and larger community, potentially leading to more stability and resources

Cons of wrk

  • Limited to HTTP/HTTPS protocols
  • Less user-friendly for beginners due to its command-line interface and Lua scripting requirement
  • Lacks built-in support for detailed result analysis and reporting

Code Comparison

wrk:

static void *thread_main(void *arg) {
    thread *t = arg;
    aeEventLoop *loop = aeCreateEventLoop(10 + cfg.connections * 3);
    t->loop = loop;
    thread_local_init(t);
    aeCreateTimeEvent(loop, CALIBRATE_DELAY_MS, calibrate, t, NULL);
    aeMain(loop);
    aeDeleteEventLoop(loop);
    return NULL;
}

bombardier:

func (b *bombardier) worker() {
    for b.barrier.tryGrabWork() {
        code, bytesRead, err := b.client.do()
        b.recordRequest(code, bytesRead, err)
    }
    b.barrier.done()
}
24,523

Write scalable load tests in plain Python 🚗💨

Pros of Locust

  • Written in Python, making it more accessible for many developers and easier to extend
  • Supports distributed load testing across multiple machines
  • Provides a web-based UI for real-time monitoring and control of tests

Cons of Locust

  • Generally slower performance compared to Bombardier due to Python's interpreted nature
  • Requires more setup and configuration for complex scenarios
  • Higher resource consumption, especially for large-scale tests

Code Comparison

Bombardier (Go):

bombardier -c 100 -n 10000 http://example.com

Locust (Python):

locust -f locustfile.py --host=http://example.com -u 100 -r 10 -t 1m

Key Differences

  • Bombardier is a single binary, while Locust requires Python installation
  • Locust offers more flexibility in test scenario design
  • Bombardier is typically faster for raw HTTP benchmarking
  • Locust provides better reporting and visualization options

Both tools have their strengths, with Bombardier excelling in simple, high-performance benchmarking, and Locust offering more comprehensive load testing capabilities and easier customization for complex scenarios.

1,884

Goad is an AWS Lambda powered, highly distributed, load testing tool

Pros of Goad

  • Distributed load testing across multiple AWS Lambda functions
  • Supports custom headers and request bodies
  • Provides real-time results visualization

Cons of Goad

  • Requires AWS account and setup
  • Limited to HTTP/HTTPS protocols
  • Less actively maintained compared to Bombardier

Code Comparison

Goad:

cfg := &goad.TestConfig{
    URL:            "http://example.com",
    Concurrency:    10,
    TotalRequests:  1000,
    RequestTimeout: 5 * time.Second,
}
result, err := goad.RunTest(cfg)

Bombardier:

b, err := bombardier.New(bombardier.Config{
    URLs:       []string{"http://example.com"},
    NumReqs:    &bombardier.Uint64Value{Value: 1000},
    Connections: 10,
    Timeout:     5 * time.Second,
})
b.Bombard()

Both tools offer similar configuration options, but Goad's setup is more focused on distributed testing, while Bombardier provides a simpler local testing approach. Goad's code emphasizes its AWS-centric nature, whereas Bombardier's code highlights its flexibility for local and single-instance testing.

3,311

Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.

Pros of Fortio

  • More comprehensive features, including support for gRPC and WebSocket protocols
  • Built-in web UI for real-time monitoring and result visualization
  • Extensive documentation and active community support

Cons of Fortio

  • Larger codebase and potentially more complex setup
  • May have higher resource usage due to additional features

Code Comparison

Fortio:

http.HandleFunc("/fortio/", fortioui.Handler)
if err := http.ListenAndServe(*addr, nil); err != nil {
    log.Fatal(err)
}

Bombardier:

b := bombardier.New(config)
b.Bombard()
b.Finish()

Fortio offers a more comprehensive HTTP server setup with built-in UI handling, while Bombardier provides a simpler, more focused API for load testing. Fortio's code snippet demonstrates its integration with a web server, whereas Bombardier's code shows a straightforward benchmarking process.

Both tools are effective for load testing, but Fortio offers more features and a user-friendly interface at the cost of increased complexity. Bombardier, on the other hand, provides a lightweight and easy-to-use solution for basic load testing scenarios.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

bombardier Build Status Go Report Card GoDoc

Logo bombardier is a HTTP(S) benchmarking tool. It is written in Go programming language and uses excellent fasthttp instead of Go's default http library, because of its lightning fast performance.

With bombardier v1.1 and higher you can now use net/http client if you need to test HTTP/2.x services or want to use a more RFC-compliant HTTP client.

Tested on go1.18 and higher.

Installation

You can grab binaries in the releases section. Alternatively, to get latest and greatest run:

Go 1.18+: go install github.com/codesenberg/bombardier@latest

Usage

bombardier [<flags>] <url>

For a more detailed information about flags consult GoDoc.

Known issues

AFAIK, it's impossible to pass Host header correctly with fasthttp, you can use net/http(--http1/--http2 flags) to workaround this issue.

Examples

Example of running bombardier against this server:

> bombardier -c 125 -n 10000000 http://localhost:8080
Bombarding http://localhost:8080 with 10000000 requests using 125 connections
 10000000 / 10000000 [============================================] 100.00% 37s Done!
Statistics        Avg      Stdev        Max
  Reqs/sec    264560.00   10733.06     268434
  Latency      471.00us   522.34us    51.00ms
  HTTP codes:
    1xx - 0, 2xx - 10000000, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:   292.92MB/s

Or, against a realworld server(with latency distribution):

> bombardier -c 200 -d 10s -l http://ya.ru
Bombarding http://ya.ru for 10s using 200 connections
[=========================================================================] 10s Done!
Statistics        Avg      Stdev        Max
  Reqs/sec      6607.00     524.56       7109
  Latency       29.86ms     5.36ms   305.02ms
  Latency Distribution
     50%    28.00ms
     75%    32.00ms
     90%    34.00ms
     99%    48.00ms
  HTTP codes:
    1xx - 0, 2xx - 0, 3xx - 66561, 4xx - 0, 5xx - 0
    others - 5
  Errors:
    dialing to the given TCP address timed out - 5
  Throughput:     3.06MB/s