All Projects → bengadbois → Pewpew

bengadbois / Pewpew

Licence: mit
Flexible HTTP command line stress tester for websites and web services

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Pewpew

Jmeter Maven Plugin
The JMeter Maven Plugin
Stars: ✭ 362 (+34.57%)
Mutual labels:  performance-analysis, performance-testing, load-testing
k6-operator
An operator for running distributed k6 tests.
Stars: ✭ 170 (-36.8%)
Mutual labels:  load-testing, performance-testing
Performance-Testing-Tools
🛠 Curated list of Performance Testing Tools ⚡ All contributions are welcome 💜
Stars: ✭ 17 (-93.68%)
Mutual labels:  load-testing, performance-testing
k6-template-typescript
Template to use TypeScript with k6
Stars: ✭ 90 (-66.54%)
Mutual labels:  load-testing, performance-testing
load-testing-toolkit
Collection of open-source tools for debugging, benchmarking, load and stress testing your code or services.
Stars: ✭ 65 (-75.84%)
Mutual labels:  load-testing, performance-testing
f1
A tool for writing load test scenarios in Golang with a powerful command line runner
Stars: ✭ 81 (-69.89%)
Mutual labels:  load-testing, performance-testing
ddosify
High-performance load testing tool, written in Golang.
Stars: ✭ 3,788 (+1308.18%)
Mutual labels:  load-testing, performance-testing
chef-load
chef-load - a tool for simulating load on a Chef Infra Server and/or a Chef Automate server
Stars: ✭ 30 (-88.85%)
Mutual labels:  load-testing, performance-testing
docker-google-lighthouse-puppeteer
Google Lighthouse + Puppeteer / Docker Image
Stars: ✭ 29 (-89.22%)
Mutual labels:  performance-analysis, performance-testing
XLT
XLT is an comprehensive load and performance test tool developed and maintained by Xceptance.
Stars: ✭ 39 (-85.5%)
Mutual labels:  load-testing, performance-testing
k6-template-es6
Template repository for bundling test projects into single test scripts runnable by k6
Stars: ✭ 39 (-85.5%)
Mutual labels:  load-testing, performance-testing
benchmark-trend
Measure performance trends of Ruby code
Stars: ✭ 60 (-77.7%)
Mutual labels:  performance-analysis, performance-testing
ctsTraffic
ctsTraffic is a highly scalable client/server networking tool giving detailed performance and reliability analytics
Stars: ✭ 125 (-53.53%)
Mutual labels:  performance-analysis, performance-testing
IGUANA
IGUANA is a benchmark execution framework for querying HTTP endpoints and CLI Applications such as Triple Stores. Contact: [email protected]
Stars: ✭ 22 (-91.82%)
Mutual labels:  performance-analysis, performance-testing
mzbench
Distributed Benchmarking
Stars: ✭ 39 (-85.5%)
Mutual labels:  load-testing, performance-testing
gatf
Generic Automated Test Framework For API/UI/RPA/Load Testing
Stars: ✭ 15 (-94.42%)
Mutual labels:  load-testing, performance-testing
k6-example-github-actions
No description or website provided.
Stars: ✭ 18 (-93.31%)
Mutual labels:  load-testing, performance-testing
jmeter-to-k6
Converts JMeter .jmx files to k6 JS code
Stars: ✭ 57 (-78.81%)
Mutual labels:  load-testing, performance-testing
ultron
new repository: https://github.com/wosai/ultron
Stars: ✭ 15 (-94.42%)
Mutual labels:  load-testing, performance-testing
awesome-gatling
A collection of resources covering different aspects of Gatling load-testing tool usage.
Stars: ✭ 36 (-86.62%)
Mutual labels:  load-testing, performance-testing

Pewpew Travis Go Report Card Coveralls branch GoDoc

Pewpew is a flexible command line HTTP stress tester. Unlike other stress testers, it can hit multiple targets with multiple configurations, simulating real world load and bypassing caches.

Disclaimer: Pewpew is designed as a tool to help those developing web services and websites. Please use responsibly.

Demo

Features

  • Multiple modes for measuring servers
  • Regular expression defined targets
  • Multiple simultaneous targets
  • No runtime dependencies, single binary file
  • Statistics on timing, data transferred, status codes, and more
  • Export raw data as TSV and/or JSON for analysis, graphs, etc.
  • HTTP2 support
  • IPV6 support
  • Tons of command line and/or config file options (arbitrary headers, cookies, User-Agent, timeouts, ignore SSL certs, HTTP authentication, Keep-Alive, DNS prefetch, and more)

Installing

Pre-compiled binaries for Windows, Mac, Linux, and BSD are available on Releases.

If you want to get the latest or build from source: install Go 1.11+ and either go get github.com/bengadbois/pewpew or git clone this repo.

Modes

Pewpew features two independent modes: stress and benchmark.

Stress mode (pewpew stress) sends requests as fast as the server can respond (limited by concurrency). This mode is usually best for answering questions such as "how fast can the server return 1000 requests?", "will the server ever OOM?", "can I get the server to 503?", and more related to overloading.

Benchmark mode (pewpew benchmark) sends requests at a fixed rate (requests per second). This mode is usually best for anwering questions such as "how much traffic can the server handle before latency surprasses 1 second?", "if traffic to the server is rate limited to 100 rps, will there by any 503s?", and other measurable controlled traffic tests.

Examples

pewpew stress -n 50 www.example.com

Make 50 requests to http://www.example.com

pewpew benchmark --rps 100 --duration 60 www.example.com

For 60 seconds, send 100 requests each second to www.example.com

pewpew stress -X POST --body '{"hello": "world"}' -n 100 -c 5 -t 2.5s -H "Accept-Encoding:gzip, Content-Type:application/json" https://www.example.com:443/path localhost 127.0.0.1/api

Make request to each of the three targets https://www.example.com:443/path, http://localhost, http://127.0.0.1/api

  • 100 requests total requests per target (300 total)
  • 5 concurrent requests per target (15 simultaneous)
  • POST with body {"hello": "world"}
  • Two headers: Accept-Encoding:gzip and Content-Type:application/json
  • Each request times out after 2.5 seconds

For the full list of command line options, run pewpew help or pewpew help stress

Using Regular Expression Targets

Pewpew supports using regular expressions (Perl syntax) to nondeterministically generate targets.

pewpew stress -r "localhost/pages/[0-9]{1,3}"

This example will generate target URLs such as:

http://localhost/pages/309
http://localhost/pages/390
http://localhost/pages/008
http://localhost/pages/8
http://localhost/pages/39
http://localhost/pages/104
http://localhost/pages/642
http://localhost/pages/479
http://localhost/pages/82
http://localhost/pages/3
pewpew stress -r "localhost/pages/[0-9]+\?cache=(true|false)(\&referrer=[0-9]{3})?"

This example will generate target URLs such as:

http://localhost/pages/278613?cache=false
http://localhost/pages/736?cache=false
http://localhost/pages/255?cache=false
http://localhost/pages/25042766?cache=false
http://localhost/pages/61?cache=true
http://localhost/pages/4561?cache=true&referrer=966
http://localhost/pages/7?cache=false&referrer=048
http://localhost/pages/01?cache=true
http://localhost/pages/767911706?cache=false&referrer=642
http://localhost/pages/68780?cache=true

Note: dots in IP addresses must be escaped, such as pewpew stress -r "http://127\.0\.0\.1:8080/api/user/[0-9]{1,3}"

Using Config Files

Pewpew supports complex configurations more easily managed with a config file. You can define one or more targets each with their own settings.

By default, Pewpew looks for a config file in the current directory and named pewpew.json or pewpew.toml. If found, Pewpew can be run like:

pewpew stress

There are examples config files in examples/.

Available global settings:

  • Count (default 10)
  • Concurrency (default 1)
  • NoHTTP2 (default false)
  • EnforceSSL (default false)
  • Quiet (default false)
  • Verbose (default false)
  • DNSPrefetch (default defer to Target)
  • Timeout (default defer to Target)
  • Method (default defer to Target)
  • Body (default defer to Target)
  • BodyFilename (default defer to Target)
  • Headers (default defer to Target)
  • Cookies (default defer to Target)
  • UserAgent (default defer to Target)
  • BasicAuth (default defer to Target)
  • Compress (default defer to Target)
  • KeepAlive (default defer to Target)
  • FollowRedirects (default defer to Target)

Available individual target settings:

  • URL (default "http://localhost")
  • RegexURL (default false)
  • DNSPrefetch (default false)
  • Timeout (default 10s)
  • Method (default GET)
  • Body (default empty)
  • RegexBody (default false)
  • BodyFilename (default none)
  • Headers (default none)
  • Cookies (default none)
  • UserAgent (default "pewpew")
  • BasicAuth (default none)
  • Compress (default false)
  • KeepAlive (default false)
  • FollowRedirects (default true)

Pewpew allows combining config file and command line settings, to maximize flexibility.

Individual target settings in the config file override any other setting, then command line flags (applied to all targets) override others, then global settings in the config file override the Pewpew's defaults.

If target URL(s) are specified on the command line, they override all targets in the config file.

Using as a Go library

package main

import (
    "fmt"
    "os"

    pewpew "github.com/bengadbois/pewpew/lib"
)

func main() {
    stressCfg := pewpew.StressConfig{
        //global settings
        Count:       1,
        Concurrency: 1,
        Verbose:     false,
        //setup one target
        Targets: []pewpew.Target{{
            URL:     "https://127.0.0.1:443/home",
            Timeout: "2s",
            Method:  "GET",
            Body:    `{"field": "data", "work": true}`,
        }},
    }

    //begin stress test
    output := os.Stdout //can be any io.Writer, such as a file
    stats, err := pewpew.RunStress(stressCfg, output)
    if err != nil {
        fmt.Printf("pewpew stress failed:  %s", err.Error())
    }

    //do whatever you want with the raw stats
    fmt.Printf("%+v", stats)
}

Full package documentation at godoc.org

Hints

If you receive a lot of "socket: too many open files" errors while running many concurrent requests, try increasing your ulimit.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].