Skip to content

Distributed Testing

kurok edited this page Mar 12, 2026 · 2 revisions

Distributed Testing

Need more load than a single machine can generate? Run pywrkr on multiple machines — one master coordinates, workers do the actual testing.

Why distributed?

A single machine can typically push 5,000-50,000 requests per second depending on hardware and the target server. If you need more, or want to test from different network locations, use distributed mode.

How it works

  Machine A (master)  ──────►  Target Server  ◄──────  Machine B (worker)
        │                                                     ▲
        │                                                     │
        └──── coordinates ────────────────────────────────────┘

  Machine C (worker)  ──────►  Target Server
  1. You start a master that waits for workers to connect
  2. You start workers on other machines, pointing them at the master
  3. The master sends the test configuration to all workers
  4. All workers start testing simultaneously
  5. Workers send results back to the master
  6. The master combines everything and shows the total results

Step 1: Start the master

On your main machine:

pywrkr http://target-server:8080/ --master --expect-workers 3 -c 100 -d 30

This means:

  • Wait for 3 workers to connect
  • Each worker will use 100 connections for 30 seconds
  • Total load: 3 workers x 100 connections = 300 connections

The master will print something like:

Master listening on 0.0.0.0:9220
Waiting for 3 workers to connect...

Step 2: Start workers

On each worker machine, run:

pywrkr --worker master-ip:9220

Replace master-ip with the IP address or hostname of your master machine.

Each worker connects, receives the configuration, and waits for the "go" signal.

Step 3: Wait for results

Once all workers connect, the master tells them to start. When they finish, you get combined results on the master:

All 3 workers connected. Starting benchmark...

======================================================================
  DISTRIBUTED BENCHMARK RESULTS (3 workers)
======================================================================
  Total Requests:    45,230
  Total Errors:      12
  Requests/sec:      1,507.67
  ...

Change the master port

By default, the master listens on port 9220. Change it:

# Master on custom port
pywrkr http://target:8080/ --master --expect-workers 2 --port 5555 -c 50 -d 30

# Workers connect to custom port
pywrkr --worker master-ip:5555

Tips

  • All workers should be on the same network (or have fast connections to the master)
  • Workers need network access to the target server — the master just coordinates, it doesn't proxy traffic
  • Start the master first, then start workers — workers will try to connect immediately
  • Use the same pywrkr version on all machines
  • Firewalls: make sure the master's port (default 9220) is open for incoming connections from workers

Clone this wiki locally