Convert Figma logo to code with AI

alexei-led logopumba

Chaos testing, network emulation, and stress testing tool for containers

3,003
202
3,003
10

Top Related Projects

11,921

:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing

10,511

Simulating shitty network connections so you can build better systems.

Quick Overview

Pumba is a chaos testing tool for Docker environments. It allows users to simulate various network conditions, resource constraints, and failure scenarios to test the resilience and reliability of containerized applications. Pumba helps identify potential issues and weaknesses in distributed systems running on Docker.

Pros

  • Easy to use and integrate into CI/CD pipelines
  • Supports a wide range of chaos experiments, including network emulation, resource limits, and container manipulation
  • Highly configurable with command-line options and YAML-based experiment definitions
  • Active development and community support

Cons

  • Limited to Docker environments, not suitable for other container runtimes or non-containerized applications
  • May require careful configuration to avoid unintended consequences in production environments
  • Documentation could be more comprehensive, especially for advanced use cases
  • Limited built-in reporting and analysis features

Getting Started

To get started with Pumba, follow these steps:

  1. Install Pumba:

    docker pull gaiaadm/pumba
    
  2. Run a simple chaos experiment (e.g., kill a container after 30 seconds):

    docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock gaiaadm/pumba pumba kill --signal SIGKILL --interval 30s re2:^myapp
    
  3. Create a YAML configuration file for more complex experiments:

    version: "0.1"
    name: network-delay-experiment
    description: Add 100ms delay to all network traffic
    tasks:
      - name: add-delay
        containers:
          - re2:^myapp
        commands:
          - netem --duration 5m delay 100
    
  4. Run the experiment using the YAML file:

    docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/experiment.yaml:/experiment.yaml gaiaadm/pumba pumba --log-level info chaos --config /experiment.yaml
    

For more advanced usage and configuration options, refer to the official Pumba documentation on GitHub.

Competitor Comparisons

11,921

:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing

Pros of Toxiproxy

  • Written in Go, offering better performance and cross-platform compatibility
  • Provides a more extensive set of network fault injection capabilities
  • Offers both a CLI and an HTTP API for easier integration into various workflows

Cons of Toxiproxy

  • Primarily focused on network-level fault injection, lacking container-specific features
  • Less suitable for Docker-centric environments compared to Pumba
  • May require additional setup for use in containerized environments

Code Comparison

Toxiproxy (Go):

proxy := toxiproxy.NewProxy("mysql", "localhost:3306", "localhost:33306")
toxic := toxiproxy.NewLatencyToxic("latency", toxiproxy.Downstream, 1000)
proxy.AddToxic(toxic)

Pumba (Shell):

pumba netem --duration 10m delay --time 1000 re2:^mysql

Both tools aim to introduce network faults for testing purposes, but Toxiproxy offers a more programmatic approach with its Go API, while Pumba provides a simpler command-line interface tailored for Docker environments. Toxiproxy excels in fine-grained network fault injection, whereas Pumba offers broader container manipulation capabilities beyond just network simulation.

10,511

Simulating shitty network connections so you can build better systems.

Pros of Comcast

  • Simpler setup and usage, focusing specifically on network condition simulation
  • Lightweight and easy to install, with fewer dependencies
  • Cross-platform support (Linux, macOS, and Windows)

Cons of Comcast

  • Limited functionality compared to Pumba, focusing only on network chaos
  • Less active development and community support
  • Lacks container-specific features and Docker integration

Code Comparison

Comcast (network delay simulation):

comcast --device=eth0 --latency=250 --target-bw=1000 --default-bw=1000000 --packet-loss=10%

Pumba (network delay simulation):

pumba netem --interface eth0 delay --time 250 --jitter 30 --correlation 20 --distribution normal

Summary

Comcast is a simpler tool focused solely on network condition simulation, offering cross-platform support and easy setup. However, it lacks the broader chaos engineering capabilities and container-specific features provided by Pumba. Pumba offers a more comprehensive suite of chaos engineering tools, including network emulation, but with a focus on Docker environments. The choice between the two depends on the specific requirements of your testing environment and the breadth of chaos engineering scenarios you need to simulate.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Pumba
Chaos testing tool for Docker and containerd

GitHub Release Release Build and Test Go Report Card Codecov License

Quick Start · User Guide · Network Chaos · Deployment · Contributing


Pumba is a chaos testing and network emulation tool for Docker and containerd containers. Inspired by Netflix Chaos Monkey, Pumba brings chaos engineering to the container level — kill, stop, pause, and remove containers, inject network delays and packet loss, or stress-test container resources.

How It Works

graph LR
    A[Pumba CLI] -->|Docker API / containerd API| B[Container Runtime]
    B -->|List & Filter| C[Target Containers]

    A -->|kill / stop / pause / rm| C

    A -->|netem / iptables| D[Helper Container / Direct Exec]
    D -->|Shares network namespace| C
    D -->|Runs tc / iptables| E[Network Chaos]

Pumba supports two container runtimes:

  • Docker (default): Uses the Docker API. For network chaos, creates a helper container sharing the target's network namespace.
  • containerd: Uses the containerd API directly. For network chaos, executes tc/iptables commands directly inside the target container (requires tools to be installed in the container image).

Features

CategoryCommandsDescription
Container Chaoskill, stop, pause, rm, restartDisrupt container lifecycle
ExecuteexecRun commands inside containers
Network Delaynetem delayAdd latency to egress traffic
Packet Lossnetem loss, iptables lossDrop packets (egress and ingress)
Network Effectsnetem duplicate, corrupt, rateDuplicate, corrupt, or rate-limit packets
Stress TestingstressCPU, memory, I/O stress via stress-ng (child cgroup or same-cgroup injection)
Targetingnames, regex (re2:), labels, --randomFlexible container selection
Scheduling--intervalRecurring chaos at fixed intervals

Quick Start

Install

Download the latest release for your platform, or use Docker:

# Binary
curl -sL https://github.com/alexei-led/pumba/releases/latest/download/pumba_linux_amd64 -o pumba
chmod +x pumba

# Docker (recommended)
docker pull ghcr.io/alexei-led/pumba:latest

First Chaos

# Kill a random container matching "test" every 30 seconds
pumba --interval=30s --random kill "re2:^test"

# Add 3 seconds network delay to mydb for 5 minutes
pumba netem --duration 5m delay --time 3000 mydb

# Drop 10% of incoming packets to myapp for 2 minutes
pumba iptables --duration 2m loss --probability 0.1 myapp

# Stress CPU of mycontainer for 60 seconds
pumba stress --duration 60s --stressors="--cpu 4 --timeout 60s" mycontainer

Containerd Runtime

# Kill a container by ID via containerd
pumba --runtime containerd --containerd-namespace k8s.io kill <container-id>

# Add network delay via containerd (requires tc in the container image)
pumba --runtime containerd --containerd-namespace moby \
  netem --duration 5m delay --time 3000 <container-id>
FlagDefaultDescription
--runtimedockerContainer runtime (docker or containerd)
--containerd-socket/run/containerd/containerd.sockcontainerd socket path
--containerd-namespacek8s.iocontainerd namespace (k8s.io for Kubernetes, moby for Docker)

Tip: For network chaos on containers without tc/iptables, use --tc-image to spawn a sidecar:

pumba --runtime containerd netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
  --duration 5m delay --time 3000 <container-id>

Run with Docker

docker run -it --rm \
  -v /var/run/docker.sock:/var/run/docker.sock \
  ghcr.io/alexei-led/pumba --interval=10s --random kill "re2:^test"

Docker Images

RegistryImageStatus
GitHub Container Registryghcr.io/alexei-led/pumba✅ Primary
Docker Hubalexeiled/pumba⚠️ Deprecated

Images are built natively for linux/amd64 and linux/arm64 (no QEMU).

Documentation

DocumentDescription
User GuideContainer chaos commands, targeting, scheduling, configuration
Network Chaosnetem, iptables, advanced scenarios, architecture diagrams
Stress TestingCPU/memory/IO stress testing with stress-ng
DeploymentDocker, Kubernetes DaemonSets, OpenShift
ContributingBuild from source, run tests, project structure

Demo

asciicast

Community & Support

License

Apache License 2.0