aykhans 80a8ba1d59 feat(logging): add runtime log levels, response logging, and progress/log-file controls
- --log-level (comma-separated string: info, error): pick which logs are emitted;
  the level set is resolved once, up front
- Log responses at the info level: full self-contained JSON to a file or stderr,
  a compact "status duration | body" summary in the TUI log box
- Route logs independently of the progress display: the TUI log box when it runs,
  stderr when piped, or a file via --log-file/-w (parent dir validated up front)
- Replace --quiet with --progress (bar | none, default bar): progress and logs are
  now independent — progress=none still shows the log box; quiet == progress=none
  with an empty log level
- Rename the internal "message" concept to "log" (runtimeLog, runtimeLogger, ...)
2026-07-22 23:20:14 +04:00
2026-01-10 17:06:25 +04:00
2024-06-02 01:21:37 +04:00
2026-04-15 18:42:06 +04:00

Sarin is a high-performance HTTP load testing tool built with Go and fasthttp.

Go Reference Go Report Card License: MIT

Demo

InstallQuick StartExamplesConfigurationTemplating

Overview

Sarin is designed for efficient HTTP load testing with minimal resource consumption. It prioritizes simplicity and features like templating add zero overhead when unused.

Supported Not Supported
High-performance with low memory footprint Detailed response body analysis
Long-running duration/count based tests Extensive response statistics
Dynamic requests via 340+ template functions Web UI or complex TUI
Request scripting with Lua and JavaScript Distributed load testing
Multiple proxy protocols
(HTTP, HTTPS, SOCKS5, SOCKS5H)
HTTP/2, HTTP/3, WebSocket, gRPC
Captcha solving
(2Captcha, Anti-Captcha, CapSolver)
Plugins / extensions ecosystem
Flexible config (CLI, ENV, YAML)

Installation

docker pull aykhans/sarin:latest

With a local config file:

docker run --rm -it -v /path/to/config.yaml:/config.yaml aykhans/sarin -f /config.yaml

With a remote config file:

docker run --rm -it aykhans/sarin -f https://example.com/config.yaml

Pre-built Binaries

Download the latest binaries from the releases page.

Building from Source

Requires Go 1.26+.

git clone https://github.com/aykhans/sarin.git && cd sarin

CGO_ENABLED=0 go build \
    -ldflags "-X 'go.aykhans.me/sarin/internal/version.Version=dev' \
    -X 'go.aykhans.me/sarin/internal/version.GitCommit=$(git rev-parse HEAD)' \
    -X 'go.aykhans.me/sarin/internal/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)' \
    -X 'go.aykhans.me/sarin/internal/version.GoVersion=$(go version)' \
    -s -w" \
    -o sarin ./cmd/cli/main.go

Quick Start

Send 10,000 GET requests with 50 concurrent connections and a random User-Agent for each request:

sarin -U http://example.com -r 10_000 -c 50 -H "User-Agent: {{ fakeit_UserAgent }}"

Run a 5-minute duration-based test:

sarin -U http://example.com -d 5m -c 100

Use a YAML config file:

sarin -f config.yaml

For more usage examples, see the Examples Guide.

Configuration

Sarin supports environment variables, CLI flags, and YAML files. When the same option is specified in multiple sources, the following priority order applies:

CLI Flags (Highest) > YAML > Environment Variables (Lowest)

For detailed documentation on all configuration options (URL, method, timeout, concurrency, headers, cookies, proxy, etc.), see the Configuration Guide.

Templating

Sarin supports Go templates in URL paths, methods, bodies, headers, params, cookies, and values. Use the 340+ built-in functions to generate dynamic data for each request.

Example:

sarin -U "http://example.com/users/{{ fakeit_UUID }}" -r 1000 -c 10 \
  -V "REQUEST_ID={{ fakeit_UUID }}" \
  -H "X-Request-ID: {{ .Values.REQUEST_ID }}" \
  -B '{"request_id": "{{ .Values.REQUEST_ID }}"}'

For the complete templating guide and functions reference, see the Templating Guide.

License

This project is licensed under the MIT License. See the LICENSE file for details.

S
Description
A high-performance HTTP load testing tool. Features dynamic request generation with 320+ template functions, proxy support, and configuration via CLI, YAML, ENV.
Readme MIT
1.8 MiB
Languages
Go 98.3%
Nix 1.3%
Dockerfile 0.4%