Convert Figma logo to code with AI

rakyll logohey

HTTP load generator, ApacheBench (ab) replacement

18,056
1,194
18,056
179

Top Related Projects

Fast cross-platform HTTP benchmarking tool written in Go

23,459

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

37,830

Modern HTTP benchmarking tool

24,772

Write scalable load tests in plain Python 🚗💨

8,235

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services

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

Hey is a modern HTTP load testing tool and benchmarking utility. It allows users to send load to a target URL with a specified number of requests, concurrency, and other parameters. Hey is designed to be simple to use and provides detailed output for analyzing server performance.

Pros

  • Easy to use with a simple command-line interface
  • Supports both HTTP and HTTPS requests
  • Provides detailed statistics and percentiles for response times
  • Lightweight and fast, written in Go

Cons

  • Limited features compared to more comprehensive load testing tools
  • No built-in support for distributed load testing
  • Lacks a graphical user interface for visualizing results
  • May not be suitable for complex load testing scenarios

Getting Started

To use Hey, first install it using Go:

go install github.com/rakyll/hey@latest

Then, you can run a basic load test with the following command:

hey https://example.com/

For more advanced usage, you can specify the number of requests and concurrency:

hey -n 1000 -c 100 https://example.com/

This will send 1000 requests with 100 concurrent workers to the specified URL. Hey will then display detailed statistics about the load test, including response times, status codes, and throughput.

Competitor Comparisons

Fast cross-platform HTTP benchmarking tool written in Go

Pros of Bombardier

  • Supports more protocols (HTTP/1.1, HTTP/2, HTTPS)
  • Offers more detailed statistics and percentiles
  • Allows for custom headers and request body

Cons of Bombardier

  • Less user-friendly command-line interface
  • Fewer built-in output formats compared to Hey

Code Comparison

Hey:

hey -n 1000 -c 100 https://example.com/

Bombardier:

bombardier -c 100 -n 1000 https://example.com/

Both tools use similar command-line syntax for basic benchmarking. However, Bombardier offers more advanced options for customizing requests:

bombardier -H "X-Custom-Header: Value" -m POST -b '{"key": "value"}' https://example.com/api

Hey and Bombardier are both HTTP load testing tools written in Go. Hey focuses on simplicity and ease of use, while Bombardier provides more advanced features and customization options. Hey is better suited for quick, straightforward benchmarks, whereas Bombardier is more appropriate for complex testing scenarios requiring detailed control over requests and comprehensive result analysis.

23,459

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

Pros of Vegeta

  • More flexible attack configuration with custom headers, body, and HTTP methods
  • Supports multiple output formats (text, JSON, Histogram)
  • Offers a library for programmatic usage in Go applications

Cons of Vegeta

  • Steeper learning curve due to more complex command-line options
  • Lacks built-in support for HTTP/2 (requires manual configuration)
  • May be overkill for simple load testing scenarios

Code Comparison

Hey:

hey -n 1000 -c 100 https://example.com

Vegeta:

echo "GET https://example.com" | vegeta attack -duration=30s -rate=100 | vegeta report

Both tools are powerful HTTP load testing utilities, but they cater to slightly different use cases. Hey is more straightforward and easier to use for quick benchmarks, while Vegeta offers greater flexibility and customization options for more complex load testing scenarios.

Hey excels in simplicity and ease of use, making it ideal for developers who need quick performance insights. It also has built-in support for HTTP/2, which is a significant advantage for modern web applications.

Vegeta, on the other hand, provides more advanced features and customization options, making it suitable for more complex load testing requirements. Its ability to be used as a library in Go applications is particularly useful for integrating load testing into existing workflows or continuous integration pipelines.

37,830

Modern HTTP benchmarking tool

Pros of wrk

  • Written in C, potentially offering better performance for high-concurrency scenarios
  • Supports Lua scripting for more complex benchmarking scenarios
  • More mature project with a longer history and larger community

Cons of wrk

  • Less user-friendly for beginners due to its command-line interface
  • Limited built-in reporting options compared to hey's more detailed output
  • Requires compilation, which may be less convenient for quick installations

Code Comparison

wrk example:

wrk -t12 -c400 -d30s http://localhost:8080/index.html

hey example:

hey -n 10000 -c 100 http://localhost:8080/index.html

Both tools offer similar basic functionality for HTTP benchmarking, but wrk's syntax is more concise while hey provides more intuitive command-line flags. hey is written in Go, making it more portable and easier to install on various platforms. wrk offers more advanced features through Lua scripting, while hey focuses on simplicity and ease of use. Overall, hey is better suited for quick, straightforward benchmarks, while wrk excels in more complex, high-performance testing scenarios.

24,772

Write scalable load tests in plain Python 🚗💨

Pros of Locust

  • More feature-rich with a web-based UI for real-time monitoring and control
  • Supports distributed load testing across multiple machines
  • Allows for complex user behavior simulation using Python scripts

Cons of Locust

  • Steeper learning curve due to its Python-based scripting approach
  • Potentially slower execution compared to Hey's Go implementation
  • Requires more setup and configuration for complex scenarios

Code Comparison

Hey:

hey -n 1000 -c 100 https://example.com

Locust:

from locust import HttpUser, task, between

class MyUser(HttpUser):
    wait_time = between(1, 3)
    
    @task
    def my_task(self):
        self.client.get("/")

Hey is a simple command-line tool for quick HTTP load testing, while Locust offers a more comprehensive framework for creating complex load testing scenarios. Hey excels in simplicity and ease of use, making it ideal for quick tests. Locust, on the other hand, provides greater flexibility and scalability, but requires more setup and knowledge of Python. The choice between the two depends on the specific requirements of your load testing needs.

8,235

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services

Pros of JMeter

  • More comprehensive and feature-rich, offering a wide range of testing capabilities
  • Supports distributed testing for large-scale performance evaluations
  • Provides a GUI for test plan creation and result analysis

Cons of JMeter

  • Steeper learning curve due to its complexity and extensive features
  • Requires more system resources, especially for large-scale tests
  • Setup and configuration can be time-consuming compared to simpler tools

Code Comparison

Hey:

http.Get(url)

JMeter:

<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request">
  <stringProp name="HTTPSampler.path">${url}</stringProp>
  <stringProp name="HTTPSampler.method">GET</stringProp>
</HTTPSamplerProxy>

Summary

JMeter is a more powerful and versatile tool for performance testing, offering a wide range of features and capabilities. However, this comes at the cost of increased complexity and resource requirements. Hey, on the other hand, is a simpler and more lightweight option, making it easier to use for quick benchmarks and load tests. The choice between the two depends on the specific testing needs and the scale of the project.

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 feature set, including support for gRPC and WebSocket protocols
  • Built-in web UI for real-time monitoring and result visualization
  • Supports custom payloads and headers for more complex testing scenarios

Cons of Fortio

  • Steeper learning curve due to more advanced features
  • Larger codebase, potentially making it harder to contribute or customize
  • May be overkill for simple HTTP load testing needs

Code Comparison

Hey:

http.NewRequest("GET", url, nil)

Fortio:

http.NewRequest("GET", url, bytes.NewReader(payload))

Both tools use Go's http.NewRequest function, but Fortio allows for custom payloads, providing more flexibility in request construction.

Summary

Fortio offers a more feature-rich load testing experience with support for various protocols and a built-in UI. However, this comes at the cost of increased complexity. Hey, on the other hand, provides a simpler, more straightforward approach to HTTP load testing, making it easier to use for basic scenarios but potentially limiting for more advanced use cases.

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

hey

Build Status

hey is a tiny program that sends some load to a web application.

hey was originally called boom and was influenced from Tarek Ziade's tool at tarekziade/boom. Using the same name was a mistake as it resulted in cases where binary name conflicts created confusion. To preserve the name for its original owner, we renamed this project to hey.

Installation

Package Managers

macOS:

  • Homebrew users can use brew install hey.

Usage

hey runs provided number of requests in the provided concurrency level and prints stats.

It also supports HTTP2 endpoints.

Usage: hey [options...] <url>

Options:
  -n  Number of requests to run. Default is 200.
  -c  Number of workers to run concurrently. Total number of requests cannot
      be smaller than the concurrency level. Default is 50.
  -q  Rate limit, in queries per second (QPS) per worker. Default is no rate limit.
  -z  Duration of application to send requests. When duration is reached,
      application stops and exits. If duration is specified, n is ignored.
      Examples: -z 10s -z 3m.
  -o  Output type. If none provided, a summary is printed.
      "csv" is the only supported alternative. Dumps the response
      metrics in comma-separated values format.

  -m  HTTP method, one of GET, POST, PUT, DELETE, HEAD, OPTIONS.
  -H  Custom HTTP header. You can specify as many as needed by repeating the flag.
      For example, -H "Accept: text/html" -H "Content-Type: application/xml" .
  -t  Timeout for each request in seconds. Default is 20, use 0 for infinite.
  -A  HTTP Accept header.
  -d  HTTP request body.
  -D  HTTP request body from file. For example, /home/user/file.txt or ./file.txt.
  -T  Content-type, defaults to "text/html".
  -a  Basic authentication, username:password.
  -x  HTTP Proxy address as host:port.
  -h2 Enable HTTP/2.

  -host	HTTP Host header.

  -disable-compression  Disable compression.
  -disable-keepalive    Disable keep-alive, prevents re-use of TCP
                        connections between different HTTP requests.
  -disable-redirects    Disable following of HTTP redirects
  -cpus                 Number of used cpu cores.
                        (default for current machine is 8 cores)

Previously known as github.com/rakyll/boom.