# Fortio — Load Testing Library and CLI from the Istio Project > Fortio is a fast, lightweight load testing tool and Go library for HTTP, gRPC, and TCP with a built-in web UI for viewing real-time latency histograms. ## Install Save as a script file and run: # Fortio — Load Testing Library and CLI from the Istio Project ## Quick Use ```bash # Install go install fortio.org/fortio@latest # or brew install fortio # Run a load test fortio load -qps 100 -t 30s http://localhost:8080/api # Open web UI fortio server ``` ## Introduction Fortio started as the load testing tool for the Istio service mesh project and has since become a standalone tool. It focuses on providing accurate latency measurements at a specified query-per-second rate, making it useful for both micro-benchmarks and sustained load testing. ## What Fortio Does - Generates constant QPS load against HTTP, gRPC, and TCP endpoints - Records latency histograms with configurable percentile reporting - Serves a web UI for triggering tests and visualizing results interactively - Functions as a Go library for embedding load generation into custom tools - Includes an echo server for testing proxies and service meshes ## Architecture Overview Fortio uses a pool of goroutines to maintain a target request rate, recording each response time in a histogram data structure. The CLI mode runs a test and prints results, while server mode exposes a REST API and web dashboard. Results are stored as JSON and can be compared across runs in the UI. The echo server component mirrors request headers and bodies for debugging network paths. ## Self-Hosting & Configuration - Install as a single binary via Go, Homebrew, or Docker - Set target QPS with -qps and duration with -t flags - Configure connection reuse, HTTP headers, and payload with CLI flags - Run in server mode to access the web UI on port 8080 - Export results as JSON for post-processing or comparison ## Key Features - Constant QPS mode provides predictable load patterns for reliable benchmarking - Accurate percentile histograms without reservoir sampling artifacts - Built-in web UI for interactive test execution and result visualization - Dual-use as both CLI tool and embeddable Go library - Lightweight single binary with minimal resource footprint ## Comparison with Similar Tools - **k6** — scriptable load testing in JavaScript; Fortio focuses on constant-rate testing with simpler configuration - **wrk** — high-performance HTTP benchmarking; Fortio adds gRPC support and a web UI - **Vegeta** — constant-rate HTTP attack tool; Fortio includes an echo server and web dashboard - **Locust** — Python-based distributed load testing; Fortio is a single-binary tool without distributed setup - **hey** — simple HTTP load generator; Fortio provides richer histogram analysis and persistent results ## FAQ **Q: What makes Fortio different from other load testing tools?** A: Fortio maintains a precise constant QPS rate and records full latency histograms, avoiding the coordinated omission problem common in other tools. **Q: Can I use Fortio as a library in my Go application?** A: Yes, Fortio provides a Go API for programmatic load generation and result collection. **Q: Does it support distributed testing?** A: Fortio is designed as a single-instance tool. For distributed scenarios you can run multiple Fortio instances and aggregate results. **Q: How do I compare results across runs?** A: The web UI supports loading multiple JSON result files and overlaying their latency histograms. ## Sources - https://github.com/fortio/fortio - https://fortio.org --- Source: https://tokrepo.com/en/workflows/asset-3190293b Author: Script Depot