Multi-Node Deployment
Deploy smtp-probe across multiple geographic regions for low-latency verification. Nodes coordinate via heartbeat and route requests to the geographically closest node.
Architecture
Client Request → Node A (Singapore)
↓ (if MX server is closer to US)
Route to Node B (US West)
↓
Node B performs verificationStarting a Node
smtp-probe serve --port 8080 \
--node-id sg-01 --region asia-southeast1 \
--lat 1.35 --lon 103.82 \
--peers http://us-node:8080,http://eu-node:8080Multi-Node Flags
| Flag | Default | Description |
|---|---|---|
--node-id | (auto) | Unique identifier for this node |
--region | — | Region name |
--lat | 0 | Latitude of this node |
--lon | 0 | Longitude of this node |
--peers | — | Initial peer addresses (comma-separated) |
--heartbeat | 30s | Heartbeat interval |
How Routing Works
- Each node registers with all peers via heartbeat (every 30s)
- When a verification request arrives, the node resolves the target MX server’s IP
- GeoIP lookup determines the MX server’s location
- Request is routed to the closest node (Haversine distance)
- If the remote node is unavailable, the request falls back to local execution
Peer API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/v1/peer/register | POST | Register a new peer node |
/v1/peer/peers | GET | List registered peers |
/v1/peer/heartbeat | POST | Heartbeat signal |
/v1/peer/geo | GET | GeoIP lookup for an IP |
Example: 3-Node Setup
# Singapore
smtp-probe serve --port 8080 \
--node-id sg-01 --region asia-southeast1 \
--lat 1.35 --lon 103.82 \
--peers http://us-node:8080,http://eu-node:8080
# US West
smtp-probe serve --port 8080 \
--node-id us-01 --region us-west1 \
--lat 37.77 --lon -122.42 \
--peers http://sg-node:8080,http://eu-node:8080
# EU (Frankfurt)
smtp-probe serve --port 8080 \
--node-id eu-01 --region eu-west1 \
--lat 50.11 --lon 8.68 \
--peers http://sg-node:8080,http://us-node:8080