goad

package module
Version: v0.0.0-...-cd2fa1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2016 License: MIT Imports: 16 Imported by: 0

README

Goad

https://goad.io

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

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, and it 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 -h
Usage of goad:
  -c uint
      number of concurrent requests (default 10)
  -m string
      HTTP method (default "GET")
  -n uint
      number of total requests to make (default 1000)
  -r string
      AWS regions to run in (comma separated, no spaces) (default "us-east-1")
  -t uint
      request timeout in seconds (default 15)
  -u string
      URL to load test (required)
  -H string
      HTTP Header to add to the request. This option can be set multiple times.

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

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

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 and publish logs.
  • 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 the Goad.io website uses to execute its tests. 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.

MIT License. Copyright 2016 Joao Cardoso, Matias Korhonen, Rasmus Sten, and Stephen Sykes.

See the LICENSE file for more details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Test

type Test struct {
	// contains filtered or unexported fields
}

Test type

func NewTest

func NewTest(config *TestConfig) (*Test, error)

NewTest returns a configured Test

func (*Test) Start

func (t *Test) Start() <-chan queue.RegionsAggData

Start a test

type TestConfig

type TestConfig struct {
	URL            string
	Concurrency    uint
	TotalRequests  uint
	RequestTimeout time.Duration
	Regions        []string
	Method         string
	Body           string
	Headers        []string
	AwsProfile     string
}

TestConfig type

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL