Toxiproxy


Toxiproxy is a framework for simulating network conditions. It's made
specifically to work in testing, CI and development environments, supporting
deterministic tampering with connections, but with support for randomized chaos
and customization. Toxiproxy is the tool you need to prove with tests that
your application doesn't have single points of failure. We've been
successfully using it in all development and test environments at Shopify since
October, 2014. See our blog post on resiliency for more information.
Toxiproxy usage consists of two parts. A TCP proxy written in Go (what this
repository contains) and a client communicating with the proxy over HTTP. You
configure your application to make all test connections go through Toxiproxy
and can then manipulate their health via HTTP. See Usage
below on how to set up your project.
For example, to add 1000ms of latency to the response of MySQL from the Ruby
client:
Toxiproxy[:mysql_master].downstream(:latency, latency: 1000).apply do
Shop.first # this takes at least 1s
end
To take down all Redis instances: