Load balancing distributes incoming requests across multiple running component instances, allowing work to proceed concurrently instead of waiting behind a single instance. In wasmCloud, the host manages replicas while the NATS lattice routes requests among them. section 6.3
A practical wasmCloud deployment applies the technique progressively:
- Increase the spreadscaler instance count, such as from 1 to 10, then redeploy the application. section 6.3
- Benchmark concurrent traffic with oha using ten requests and five concurrent connections. section 6.3
- Distribute replicas across labeled hosts with weighted placement, such as 80% in us-east-1 and 20% in us-west-1. section 6.4
- Inspect host inventory and simulate an outage by shutting down one host, then verify the remaining deployment. section 6.4
Ten replicas reduce waiting
A sample HTTP component deliberately sleeps for two seconds per request. With one replica, ten requests complete in about 20 seconds, averaging 0.50 requests per second. With ten replicas, the same benchmark finishes in about 4.09 seconds, averaging 2.44 requests per second, with response times near two seconds. section 6.3
- type: spreadscaler
properties:
instances: 10
Shows the compact spreadscaler configuration that changes the application from a single instance to ten replicas. section 6.3












