Repository navigation
Distributed Testing
Need more load than a single machine can generate? Run pywrkr on multiple machines — one master coordinates, workers do the actual testing.
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.
Machine A (master) ──────► Target Server ◄────── Machine B (worker)
│ ▲
│ │
└──── coordinates ────────────────────────────────────┘
Machine C (worker) ──────► Target Server
- You start a master that waits for workers to connect
- You start workers on other machines, pointing them at the master
- The master sends the test configuration to all workers
- All workers start testing simultaneously
- Workers send results back to the master
- The master combines everything and shows the total results
On your main machine:
pywrkr http://target-server:8080/ --master --expect-workers 3 -c 100 -d 30This 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...
On each worker machine, run:
pywrkr --worker master-ip:9220Replace master-ip with the IP address or hostname of your master machine.
Each worker connects, receives the configuration, and waits for the "go" signal.
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
...
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- 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