Friendly in development. Fast in production. Just build your apps. Let Achieve do the rest.

← Back to main examples index
Use the tabs to inspect the code behind this demonstration.

Cluster

From the extracted distribution, run npm run start:cluster. It starts the single-process server on port 8989 and the clustered server on port 8990. Refresh this page after starting the servers.

SCENARIO: Your application needs more processing power than a single Node.js process can provide.

Node's cluster support lets Achieve run multiple worker processes across multiple CPU cores.

This demonstration runs 16 CPU-intensive prime-number calculations first with a single Achieve process and then with multiple Achieve cluster workers.

The test runs automatically. The results below show the elapsed time for each batch.

Single process
Calculating...
Cluster
Waiting...

Results will vary with the application, workload, available CPU cores, hardware, and other activity on the system.

Achieve can scale across CPU cores. Node's cluster support does the rest.