TCP proxy that simulates network and system conditions for chaos and resiliency testing
open sourceMITself-hostablefree
Toxiproxy is a TCP proxy from Shopify for simulating network conditions in testing, CI and development environments. You point your application's test connections at Toxiproxy instead of the real service (MySQL, Redis or anything over TCP), then add 'toxics' through its HTTP API or a client library to tamper with those connections deterministically or at random: latency with jitter, taking a service down, bandwidth limits, slow close, timeouts, connection resets, slicing data into small packets, data limits and packet loss. It's built to prove with tests that an application has no single points of failure, runs cross-platform without root, includes a CLI, exposes Prometheus metrics, and has client libraries for Ruby and Go plus community clients for Python, .NET, PHP, Node.js, Java, Haskell, Rust and Elixir. Shopify has used it in all its development and test environments since 2014.
Problems it solves
- test how my app behaves when the database is slow or down
- simulate network latency and packet loss in integration tests
- chaos testing for service dependencies in CI
- prove my application has no single point of failure
- inject timeouts and connection resets into a TCP connection
Features
- TCP proxy controlled over an HTTP API
- toxics: latency, down, bandwidth, slow_close, timeout, reset_peer, slicer, limit_data, packet_loss
- per-direction (upstream/downstream) toxics
- randomised toxicity percentage and jitter
- toxiproxy-cli command-line client
- Prometheus metrics at /metrics
- Ruby and Go clients plus community clients in many languages
- no root needed, cross-platform
Limitations
- Only proxies TCP connections1
- MySQL clients connecting to localhost may use the Unix socket and bypass the proxy; use 127.0.0.11
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
| Has official SDKs | plan not known |
