{"id":13582467,"url":"https://github.com/bengadbois/pewpew","last_synced_at":"2025-07-18T06:37:46.573Z","repository":{"id":12189005,"uuid":"70748642","full_name":"bengadbois/pewpew","owner":"bengadbois","description":"Flexible HTTP command line stress tester for websites and web services","archived":false,"fork":false,"pushed_at":"2024-06-19T23:44:32.000Z","size":3047,"stargazers_count":426,"open_issues_count":1,"forks_count":38,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-06T14:36:30.546Z","etag":null,"topics":["load-testing","performance-analysis","performance-testing","stress-tester","stress-testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bengadbois.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-12T22:59:40.000Z","updated_at":"2025-03-24T14:07:28.000Z","dependencies_parsed_at":"2024-06-18T21:14:21.525Z","dependency_job_id":"e3bc5f55-8ee7-402b-b4c5-3e106eca98ff","html_url":"https://github.com/bengadbois/pewpew","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/bengadbois/pewpew","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengadbois%2Fpewpew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengadbois%2Fpewpew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengadbois%2Fpewpew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengadbois%2Fpewpew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bengadbois","download_url":"https://codeload.github.com/bengadbois/pewpew/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengadbois%2Fpewpew/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265711442,"owners_count":23815537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["load-testing","performance-analysis","performance-testing","stress-tester","stress-testing"],"created_at":"2024-08-01T15:02:44.673Z","updated_at":"2025-07-18T06:37:46.557Z","avatar_url":"https://github.com/bengadbois.png","language":"Go","funding_links":[],"categories":["Software Packages","Go","软件包","Go Tools","Go 工具","軟件包","DevOps Tools"],"sub_categories":["DevOps Tools","DevOps 工具","devops 工具","DevOps工具","代码分析"],"readme":"# Pewpew [![Workflow](https://img.shields.io/github/actions/workflow/status/bengadbois/pewpew/build-and-test.yml?branch=master\u0026style=flat-square)](https://github.com/bengadbois/pewpew/actions/workflows/build-and-test.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/bengadbois/pewpew?style=flat-square)](https://goreportcard.com/report/github.com/bengadbois/pewpew) [![Coveralls branch](https://img.shields.io/coveralls/bengadbois/pewpew/master.svg?style=flat-square)](https://coveralls.io/github/bengadbois/pewpew?branch=master) [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/bengadbois/pewpew/lib)\n\nPewpew 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.\n\n**Disclaimer**: Pewpew is designed as a tool to help those developing web services and websites. Please use responsibly.\n\n![Demo](screencast.gif)\n\n## Features\n- Multiple modes for measuring servers\n- Regular expression defined targets\n- Multiple simultaneous targets\n- No runtime dependencies, single binary file\n- Statistics on timing, data transferred, status codes, and more\n- Export raw data as TSV and/or JSON for analysis, graphs, etc.\n- HTTP2 support\n- IPV6 support\n- 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)\n\n## Installing\nPre-compiled binaries for Windows, Mac, Linux, and BSD are available on [Releases](https://github.com/bengadbois/pewpew/releases).\n\nIf 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.\n\n## Modes\nPewpew features two independent modes: stress and benchmark.\n\nStress 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.\n\nBenchmark 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.\n\n## Examples\n```\npewpew stress -n 50 www.example.com\n```\nMake 50 requests to http://www.example.com\n\n```\npewpew benchmark --rps 100 --duration 60 www.example.com\n```\nFor 60 seconds, send 100 requests each second to www.example.com\n\n```\npewpew 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\n```\nMake request to each of the three targets https://www.example.com:443/path, http://localhost, http://127.0.0.1/api\n - 100 requests total requests per target (300 total)\n - 5 concurrent requests per target (15 simultaneous)\n - POST with body `{\"hello\": \"world\"}`\n - Two headers: `Accept-Encoding:gzip` and `Content-Type:application/json`\n - Each request times out after 2.5 seconds\n\nFor the full list of command line options, run `pewpew help` or `pewpew help stress`\n\n### Using Regular Expression Targets\nPewpew supports using regular expressions (Perl syntax) to nondeterministically generate targets.\n```\npewpew stress -r \"localhost/pages/[0-9]{1,3}\"\n```\nThis example will generate target URLs such as:\n```\nhttp://localhost/pages/309\nhttp://localhost/pages/390\nhttp://localhost/pages/008\nhttp://localhost/pages/8\nhttp://localhost/pages/39\nhttp://localhost/pages/104\nhttp://localhost/pages/642\nhttp://localhost/pages/479\nhttp://localhost/pages/82\nhttp://localhost/pages/3\n```\n\n```\npewpew stress -r \"localhost/pages/[0-9]+\\?cache=(true|false)(\\\u0026referrer=[0-9]{3})?\"\n```\nThis example will generate target URLs such as:\n```\nhttp://localhost/pages/278613?cache=false\nhttp://localhost/pages/736?cache=false\nhttp://localhost/pages/255?cache=false\nhttp://localhost/pages/25042766?cache=false\nhttp://localhost/pages/61?cache=true\nhttp://localhost/pages/4561?cache=true\u0026referrer=966\nhttp://localhost/pages/7?cache=false\u0026referrer=048\nhttp://localhost/pages/01?cache=true\nhttp://localhost/pages/767911706?cache=false\u0026referrer=642\nhttp://localhost/pages/68780?cache=true\n```\n\nNote: dots in IP addresses must be escaped, such as `pewpew stress -r \"http://127\\.0\\.0\\.1:8080/api/user/[0-9]{1,3}\"`\n\n### Using Config Files\n\nPewpew supports complex configurations more easily managed with a config file. You can define one or more targets each with their own settings.\n\nBy 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:\n```\npewpew stress\n```\n\nThere are examples config files in `examples/`.\n\nPewpew allows combining config file and command line settings, to maximize flexibility. Pewpew uses [https://github.com/spf13/viper](Viper) and follows its rules of config precedence.\n\n### Other Options\n\nThe full list of options for each command can be viewed by running Pewpew with the `--help` flag.\n\n## Using as a Go library\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    pewpew \"github.com/bengadbois/pewpew/lib\"\n)\n\nfunc main() {\n    stressCfg := pewpew.StressConfig{\n        Count:       1,\n        Concurrency: 1,\n        Verbose:     false,\n        Targets: []pewpew.Target{{\n            URL: \"https://127.0.0.1:443/home\",\n            Options: pewpew.TargetOptions{\n                Timeout: \"2s\",\n                Method:  \"GET\",\n                Body:    `{\"field\": \"data\", \"work\": true}`,\n            },\n        }},\n    }\n\n    output := os.Stdout\n    stats, err := pewpew.RunStress(stressCfg, output)\n    if err != nil {\n        fmt.Printf(\"pewpew stress failed:  %s\", err.Error())\n    }\n\n    fmt.Printf(\"%+v\", stats)\n}\n```\nFull package documentation at [godoc.org](https://godoc.org/github.com/bengadbois/pewpew/lib)\n\n## Hints\n\nIf you receive a lot of \"socket: too many open files\" errors while running many concurrent requests, try increasing your ulimit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengadbois%2Fpewpew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbengadbois%2Fpewpew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengadbois%2Fpewpew/lists"}