stackapRequest access

Product

Scaling

Stackap scales an app by running several copies of it, from one to eight, on the same server behind a load balancer that sends each request to the least busy copy.

What it does

Scaling is a single call that sets the number of copies: PUT /v1/projects/:slug/scale with a number from 1 to 8. New copies start and pass their health check before any traffic reaches them, and a deploy requires every copy to be healthy before it counts as live.

Requests are spread across copies by least-connections, and if one copy fails, the load balancer stops sending to it and carries on with the rest. A copy was killed in a test and no request failed.

The reason this helps is mundane. A Node process uses one core, so one copy of a busy app leaves most of a four-core machine idle. Running more copies puts the idle cores to work.

How it works

Measured on one 4-CPU server serving a real site's pages, with 256 connections and no errors:

CopiesRequests per second
1about 426
2about 606
3about 683

At three copies the server's load average peaked at 4.6 on four cores, so that is roughly where one machine tops out for that kind of page. A total cap on copies across all projects, set by the operator, stops one project from using the whole machine.

Early-access scope

Questions

Can I scale the database?
Not by this mechanism. Copies are for apps. There is one Postgres server, no read replica and no pooler yet.
What is the next step beyond one server?
The plan is a load balancer with a stable address, the database on its own server, a job queue, and then several app servers. None of that is built, and it is a plan, not a date.

Stackap is in early access. Tell us what you run and we will reply with a straight answer about whether it fits.

Ask for an invitation

Last updated .