This repository contains a macOS Keynote presentation about how to perform
resilience tests under Docker for Mac with tc
. It focuses on delaying
the (isolated) service and client network in order to test and detect
connection and R/W timeout problems.
-
Run the following command from the project root. This will install all dependencies.
script/bootstrap
-
Checkout the commit tagged
start
-
Demonstration:
docker-compose up
-
Run the presentation from
apps/resilience-talk/res/
-
Stop demo
Ctrl + C docker-compose down -v
-
Accompany presentation with commits starting with "ACT-"
While running the demo, screen
into Docker for Mac
VM and investigate the
networks:
Note: >
denote output examples.
# show id of network "slownet"
(host) docker network ls | grep slownet
(host) > f5c43d88f2b6 playground_slownet bridge local
# screen tunnel into the xhyve VM
(vm) screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
# find network
(vm) ifconfig | grep <id from first command>
(vm) > br-f5c43d88f2b6 Link encap:Ethernet HWaddr 02:42:E7:82:DF:BA
# add a delay rule to the network interface
(vm) tc qdisc add dev br-c0aca63f9c15 root netem delay 500ms
# remove delay rule from the network interface
(vm) tc qdisc del dev br-f5c43d88f2b6 root netem
# disconnect from session but leave it open in the background
Ctrl-a d
# list sessions still running in the background
screen -ls
# reconnect to a session
screen -r <session id>
# kill the current active session
Ctrl-a k
- Slow down your internet with tc
- How can I rate limit network traffic on a docker container
- Network emulation for Docker containers
- pgorczak/netz
- lukaszlach/docker-tc
- thombashi/tcconfig
- alexei-led/pumba
- Apply NetEM WAN delay on a docker container interface // Docker Network for throttling a single service only
- Docker for Mac Shell
tc
command examples- more
tc
command examples