Convert Figma logo to code with AI

goadapp logogoad

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

1,884
190
1,884
34

Top Related Projects

18,056

HTTP load generator, ApacheBench (ab) replacement

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 🚗💨

Fast cross-platform HTTP benchmarking tool written in Go

Quick Overview

Goad is an AWS Lambda-powered, distributed load testing tool. It allows users to simulate high traffic loads on web applications by leveraging the scalability of AWS Lambda functions, enabling comprehensive stress testing and performance analysis.

Pros

  • Highly scalable load testing using AWS Lambda
  • Distributed architecture for realistic traffic simulation
  • Easy to use CLI interface
  • Supports custom HTTP headers and request bodies

Cons

  • Requires AWS account and credentials
  • Limited to HTTP/HTTPS protocols
  • May incur AWS costs during load tests
  • Learning curve for advanced configurations

Code Examples

// Create a new Goad test configuration
config := &goad.TestConfig{
    URL:            "https://example.com",
    Concurrency:    10,
    TotalRequests:  1000,
    RequestTimeout: 5 * time.Second,
}

// Run the load test
result, err := goad.RunTest(config)
if err != nil {
    log.Fatal(err)
}

// Print the results
fmt.Printf("Total requests: %d\n", result.TotalRequests)
fmt.Printf("Average response time: %s\n", result.AverageResponseTime)
// Create a custom HTTP request
config := &goad.TestConfig{
    URL:         "https://api.example.com/data",
    Method:      "POST",
    Body:        []byte(`{"key": "value"}`),
    ContentType: "application/json",
    Headers: map[string]string{
        "Authorization": "Bearer token123",
    },
}

// Run the load test with custom request
result, err := goad.RunTest(config)
// Run a load test with multiple regions
config := &goad.TestConfig{
    URL:         "https://global.example.com",
    Concurrency: 100,
    Regions:     []string{"us-east-1", "eu-west-1", "ap-southeast-2"},
}

result, err := goad.RunTest(config)

Getting Started

  1. Install Goad:

    go get github.com/goadapp/goad
    
  2. Set up AWS credentials:

    export AWS_ACCESS_KEY_ID=your_access_key
    export AWS_SECRET_ACCESS_KEY=your_secret_key
    
  3. Run a basic load test:

    goad -u https://example.com -c 10 -n 1000
    

This will run a load test against https://example.com with 10 concurrent users and 1000 total requests.

Competitor Comparisons

18,056

HTTP load generator, ApacheBench (ab) replacement

Pros of Hey

  • Simpler and more straightforward to use
  • Supports HTTP/2 by default
  • Actively maintained with recent updates

Cons of Hey

  • Limited to HTTP load testing only
  • Lacks distributed testing capabilities
  • Fewer customization options compared to Goad

Code Comparison

Hey:

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

Goad:

goad -n 1000 -c 100 -r us-east-1,eu-west-1 https://example.com

Hey focuses on simplicity, making it easy to run quick load tests with a single command. It's well-suited for basic HTTP testing scenarios and supports HTTP/2 out of the box.

Goad, on the other hand, offers more advanced features like distributed load testing across multiple AWS regions. This makes it more suitable for complex, large-scale testing scenarios.

Hey's codebase is more compact and easier to understand, while Goad provides more extensive configuration options and infrastructure for distributed testing.

Both tools are written in Go and serve similar purposes, but cater to different complexity levels of load testing requirements. Hey is ideal for quick, simple tests, while Goad is better suited for more comprehensive, distributed load testing scenarios.

23,459

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

Pros of Vegeta

  • More mature and widely used project with a larger community
  • Supports multiple output formats (JSON, CSV, Histogram)
  • Can be used as a library in Go programs for custom load testing scenarios

Cons of Vegeta

  • Limited to HTTP/HTTPS protocols
  • Lacks distributed load testing capabilities out of the box
  • Less user-friendly for those unfamiliar with command-line tools

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()

for res := range attacker.Attack(targeter, rate, duration, "Big Bang!") {
    // Process results
}

Goad:

test := goad.NewTest(&goad.TestConfig{
    URL:       "http://example.com",
    Method:    "GET",
    Concurrency: 10,
    TotalRequests: 1000,
    Timeout:   time.Second * 5,
})

result, err := test.Run()
if err != nil {
    log.Fatal(err)
}

Both tools offer similar functionality for load testing, but Vegeta provides more flexibility as a library, while Goad focuses on ease of use and distributed testing capabilities.

37,830

Modern HTTP benchmarking tool

Pros of wrk

  • Written in C, offering high performance and low resource usage
  • Simple and straightforward command-line interface
  • Supports Lua scripting for custom request generation and response handling

Cons of wrk

  • Limited to HTTP/HTTPS protocols
  • Lacks built-in distributed testing capabilities
  • Less extensive reporting and visualization options

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, RECORD_INTERVAL_MS, record_rate, t, NULL);
    aeMain(loop);
    aeDeleteEventLoop(loop);
    return NULL;
}

Goad:

func (l *Loader) Run() error {
    var wg sync.WaitGroup
    for i := 0; i < l.config.Concurrency; i++ {
        wg.Add(1)
        go l.runWorker(&wg)
    }
    wg.Wait()
    return nil
}

The code snippets show the core functionality of each tool. wrk uses a C-based event loop for handling connections, while Goad utilizes Go's concurrency features with goroutines and wait groups for distributed load testing.

24,772

Write scalable load tests in plain Python 🚗💨

Pros of Locust

  • More mature and widely adopted project with a larger community
  • Supports distributed load testing out of the box
  • Offers a web-based UI for real-time monitoring and control

Cons of Locust

  • Written in Python, which may be slower than Go for certain operations
  • Requires more setup and configuration compared to Goad's simplicity
  • Limited to HTTP/HTTPS protocols without extensions

Code Comparison

Locust:

from locust import HttpUser, task, between

class MyUser(HttpUser):
    wait_time = between(1, 3)

    @task
    def my_task(self):
        self.client.get("/")

Goad:

goad.Run(goad.RunConfig{
    URL:       "http://example.com",
    Concurrency: 10,
    Requests:    1000,
    Timelimit:   300,
})

Summary

Locust is a more feature-rich and mature load testing tool with a larger community, offering distributed testing and a web UI. However, it may be slower and require more setup than Goad. Goad, being written in Go, is potentially faster and simpler to use but lacks some advanced features of Locust. The choice between the two depends on specific project requirements and team expertise.

Fast cross-platform HTTP benchmarking tool written in Go

Pros of Bombardier

  • Written in Go, offering better performance and lower resource usage
  • Supports HTTP/1.1, TLS, and HTTP/2 protocols
  • Provides more detailed statistics and percentiles in the output

Cons of Bombardier

  • Lacks distributed load testing capabilities
  • Does not offer cloud-based testing options
  • Limited customization options for complex scenarios

Code Comparison

Bombardier:

b, err := bombardier.New(bombardier.Config{
    NumReqs:    &numReqs,
    Duration:   &duration,
    URL:        url,
    Method:     method,
    Body:       body,
    Headers:    headers,
    Timeout:    timeout,
    Client:     client,
})

Goad:

test := goad.NewTest(&goad.TestConfig{
    URL:            url,
    Concurrency:    concurrency,
    TotalRequests:  requests,
    RequestTimeout: timeout,
    Region:         region,
    Method:         method,
})

Key Differences

  • Goad focuses on distributed load testing using AWS Lambda, while Bombardier is a single-machine load testing tool
  • Bombardier offers more detailed performance metrics and supports various HTTP protocols
  • Goad provides cloud-based testing capabilities, allowing for larger-scale tests across multiple regions

Both tools are useful for load testing, but they cater to different use cases. Bombardier is better suited for local or single-server testing, while Goad excels in distributed, cloud-based 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

Goad

https://goad.io

Goad is an AWS Lambda powered, highly distributed, load testing tool built in Go for the 2016 Gopher Gala.

Go + Load ⇒ Goad

Goad allows you to load test your websites from all over the world whilst costing you the tiniest fractions of a penny by using AWS Lambda in multiple regions simultaneously.

You can run Goad from your machine using your own AWS credentials. Goad will automatically create the AWS resources you need and execute your test, and display the results broken down by region. This way, you can see how fast your website is from the major regions of the world.

If you just want to try Goad out, visit the Goad.io website and enter the address of the site you want to test.

goad CLI interface

Installation

Binary

The easiest way is to download a pre-built binary from Goad.io or from the GitHub Releases page.

From source

To build the Goad CLI from scratch, make sure you have a working Go 1.5 workspace (instructions), then:

  1. Fetch the project with go get:
go get github.com/goadapp/goad
  1. Install Go bindata:
go get -u github.com/jteeuwen/go-bindata/...
  1. Run make to build for all supported platforms
make

Alternatively, run append osx, linux, or windows to just build for one platform, for example:

make osx
  1. You'll find your goad binary in the build folder…

Usage

AWS credentials

Goad will read your credentials from ~/.aws/credentials or from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables (more info).

CLI

# Get help:
$ goad --help
usage: goad [<flags>] [<url>]

An AWS Lambda powered load testing tool

Flags:
  -h, --help                     Display usage information (this message)
  -n, --requests=2000            Number of requests to perform. Set to 0 in combination with a specified timelimit allows for unlimited requests for the specified time.
  -c, --concurrency=10           Number of multiple requests to make at a time
  -t, --timelimit=3600           Seconds to max. to spend on benchmarking
  -s, --timeout=15               Seconds to max. wait for each response
  -H, --header=HEADER ...        Add Arbitrary header line, eg. 'Accept-Encoding: gzip' (repeatable)
  -m, --method="GET"             HTTP method
      --body=BODY                HTTP request body
      --json-output=JSON-OUTPUT  Optional path to file for JSON result storage
      --region=us-east-1 ...     AWS regions to run in. Repeat flag to run in more then one region. (repeatable)
      --run-docker               execute in docker container instead of aws lambda
      --create-ini-template      create sample configuration file "goad.ini" in current working directory
  -V, --version                  Show application version.

Args:
  [<url>]  [http[s]://]hostname[:port]/path optional if defined in goad.ini

# For example:
$ goad -n 1000 -c 5 https://example.com

Note that sites such as https://google.com that employ redirects cannot be tested correctly at this time.

Settings

Goad supports to load settings stored in an ini file. It looks for a goad.ini file in the current working directory. Flags set on the command-line will be overwrite these settings.

[general]
#url = http://example.com/
timeout = 3600
concurrency = 10
requests = 1000
timelimit = 15
json-output = test-result.json
method = GET
body = Hello world

[regions]
us-east-1 ;N.Virginia
#us-east-2 ;Ohio
#us-west-1 ;N.California
#us-west-2 ;Oregon
eu-west-1 ;Ireland
#eu-central-1 ;Frankfurt
#ap-southeast-1 ;Singapore
#ap-southeast-2 ;Sydney
#ap-northeast-1 ;Tokyo
#ap-northeast-2 ;Seoul
#sa-east-1 ;Sao Paulo

[headers]
cache-control: no-cache
auth-token: YOUR-SECRET-AUTH-TOKEN

Docker

Goad can also be run as a Docker container which exposes the web API:

docker build -t goad .
docker run --rm -p 8080:8080 -e AWS_ACCESS_KEY_ID=<your key ID> -e AWS_SECRET_ACCESS_KEY=<your key> goad

You can then execute a load test using WebSocket:

ws://localhost:8080/goad?url=https://example.com&requests=1000&concurrency=10&timelimit=3600&timeout=15&region[]=us-east-1&region[]=eu-west-1

How it works

Goad takes full advantage of the power of Amazon Lambdas and Go's concurrency for distributed load testing. You can use Goad to launch HTTP loads from up to four AWS regions at once. Each lambda can handle hundreds of concurrent connections, we estimate that Goad should be able to achieve peak loads of up to 100,000 concurrent requests.

Goad diagram

Running Goad will create the following AWS resources:

  • An IAM Role for the lambda function.
  • An IAM Role Policy that allows the lambda function to send messages to SQS, to publish logs and to spawn new lambda in case an individual lambda times out on a long running test.
  • A lambda function.
  • An SQS queue for the test.

A new SQS queue is created for each test run, and automatically deleted after the test is completed. The other AWS resources are reused in subsequent tests.

How it was built

Go CLI and server

Goad executable

Written in pure Go, Goad takes care of instantiating all the AWS resources, collecting results and displaying them. Interestingly, it contains the executable of the Lambda worker, which is also written in Go.

There is also a webapi version, which can be used to serve Goad as a web service. This streams the results using WebSockets.

Lambda workers

AWS Lambda instances are bootstrapped using node.js but the actual work on the Lambda instances is performed by a Go process. The HTTP requests are distributed among multiple Lambda instances each running multiple concurrent goroutines, in order to achieve the desired concurrency level with high throughput.

License & Copyright

MIT License.
Copyright 2016 Joao Cardoso, Matias Korhonen, Rasmus Sten, and Stephen Sykes.
Copyright 2016 Guido Serra OLX, a Naspers company.
Copyright 2017 Walter Marta, Clemens Wältken Edrans/OLX.

See the LICENSE file for more details.