The Foundation: Little's Law

L = λ × W

The entire simulation is anchored by Little's Law — the fundamental theorem of queuing theory. It guarantees that for any stable system, the average concurrency (L) equals throughput (λ) times latency (W).

What reaches each component: a component passes on its Request Absorption Rate share of what it receives (1 = everything); a CDN, Redis or Nginx proxy cache passes on only its misses. The engine uses this one rule both for the load each component's model sees and for the requests it samples, so a database behind an API is loaded by exactly the traffic that reaches it.
L
Concurrency

In-flight requests active at any instant — bounded by your connection pool.

λ
Throughput

Successfully served requests per second after dropping errors.

W
Latency

Full residence time: queuing wait + service time across every hop.

Practical intuition: If your P99 latency doubles (W↑), your effective throughput (λ) must halve for a fixed thread pool (L). This is why a single slow database query can starve your entire web tier of connections.

Saturation Formula

ρ = (RPS × Latency_ms / 1000) / MaxConnections

When ρ > 1.0 the node is over-saturated. The engine adds a queuing penalty of (ρ − 1) × 25ms per unit of overflow. If ρ > 2.5, there is a 40% chance of a dropped request (simulating connection queue exhaustion).

Nested Private Services

In a multi-service design you can drop one private service inside another as a Microservice node. The engine does not replay a frozen benchmark snapshot for that node. Instead, before sampling begins, it simulates the nested service's entire internal architecture against the exact RPS it receives in the current run, then feeds the resulting latency, error rate, and saturation back into the parent simulation.

How a Microservice node is resolved

effRPS = systemRPS × trafficWeight(node) innerResult = simulate(service.canvas, effRPS) ← full recursive run node.latency = innerResult.p50 node.errorRate = innerResult.errorRatePct node.saturation = peak internal node saturation

Because the nested error rate drives both the node and the request path, per-node and overall metrics always agree. A service that is healthy at 100 RPS but collapses at 100k RPS will show exactly that — its internal Server/DB tiers saturate under the real load instead of reporting infinite capacity. Recursion is depth-guarded (up to 4 levels) so deeply composed systems resolve without runaway loops.

Each Microservice node also exposes a Request Absorption Rate. When a service references another service internally, this rate is the probability that an inbound request cascades to the downstream service — modelling caching, early returns, or validation that "absorbs" traffic at the edge.

Example: if user-service sits at the project root and is also nested inside both payment-service and lifestyle-service with an absorption rate of 1.0, it accumulates traffic from all three paths — direct plus both cascades — rather than only its direct share.

Network Physics

Every hop between nodes pays a network cost before any component logic runs. The cost depends on whether the nodes share a host, a VPC or a region.

Same host
Loopback or the Docker bridge — no network at all
0.1ms
Same VPC
Private subnet routing — essentially free
0.5ms
Same region, different VPC
VPC peering or transit gateway
3–5ms
Cross-region
Backbone transit over geographic distances
60–100ms
Public Internet (no VPC)
At least one node outside a private network
15–25ms
Leaving / entering a host
Payload × 8 ÷ link speed, queued as the shared NIC fills (see Shared Hosts)
+NIC
HTTPS / TLS
Handshake + encryption overhead on top of network
+3ms
mTLS (strict)
Mutual certificate exchange (service mesh)
+2ms
gRPC / protobuf
Binary serialization reduces payload size → 30% lower transmission latency
−30%

Shared Hosts

A Host / VPS box is one machine. Every component dropped inside it — Nginx, your API, Redis, Postgres, workers — competes for the same CPU cores, RAM and network link. Without a host, each component is simulated as if it had a machine to itself, so a single VPS running five Docker containers looks far stronger than it is. With a host, a busy database slows the API next to it, exactly as it does on the real box.

VPC — a network

Decides how far apart components are: 0.5 ms inside one VPC, 3–5 ms between VPCs, 60–100 ms across regions. Says nothing about CPU or RAM.

Host — a machine

Pools CPU, RAM and network for everything inside it. Components on one host talk over loopback (0.1 ms). A host can sit inside a VPC; its components then belong to both.

Model your VPS

  1. 1
    Add the machine

    Drag Host / VPS (Infrastructure) onto the canvas. In its settings, pick a size preset or type the vCPU and RAM, and set the link speed.

  2. 2
    Put your services inside

    Drag components into the box: Nginx → Nginx, your service → Container, Redis → Redis, Postgres → SQL Database, a job queue → Message Queue, workers → Service Worker. Each one shows the host’s name once it is on it.

  3. 3
    Set each component’s real limits

    A container’s CPU and RAM are its Docker limits. Postgres RAM is what it holds (shared_buffers plus work memory), Redis memory is its maxmemory, a worker pool is workers × memory per worker. Set the workers’ CPU-bound share to how much of a job is computation rather than waiting on I/O.

  4. 4
    Step up the load

    Run benchmarks at rising RPS — 100, 500, 1 000, 2 000. Watch the host’s gauges and the Shared hosts section of the results. The RPS where CPU, RAM or network crosses 85% is your machine’s practical capacity.

Reading the host box

The strip under the host's header has three gauges. Before a benchmark only RAM has a value — the memory its components hold, which is known from configuration — so an over-packed box shows up while you are still drawing it. After a benchmark all three show the last run's use against the machine.

Up to 60%
Comfortable headroom
60–85%
Busy; queueing starts
85–100%
Near the limit; latency climbs steeply
Over 100%
Overloaded; the box shows “Over” and requests fail

When contention costs real time, the box also says how many times slower its components work. The host's settings break CPU use down per component, so the neighbour eating the machine is easy to find.

How the engine models it

Contention has to be known before the measured run, and it depends on how often each component is really hit. So a short pilot pass first routes requests through the design with no host effects and counts visits. From those rates the engine adds up each host's CPU, RAM and network demand, and the measured run then applies the result to every component on the box: their processing takes slowdown times longer, and each request that touches the host completes with probability completion.

CPU

Each component's demand is its arrival rate divided by what one core serves, capped at its own CPU limit — a container set to 2 cores never takes more than 2, however busy it is. A worker pool uses its busy workers, min(jobs/s × jobDuration, workerCount), times its CPU-bound share. Waiting for a free core follows Sakasegawa's M/M/c approximation, which stays near zero on a quiet box and climbs steeply as the last cores fill. Past 100%, each request also gets only 1/ρ of the core time it needs.

ρ = Σ demand / vCPU   (c = vCPU)
slowdown = (1 + ρ^(√(2(c+1))−1) / (c(1−ρ))) × max(1, ρ)
completion = 1 / max(1, ρ)

RAM

RAM is what components hold at peak — their configured memory — plus 512 MB for the OS and Docker. Over-committing a machine makes it swap, which is about ten times slower than memory, and the OOM killer starts failing requests:

over = RAM held / RAM − 1   (only when positive)
slowdown × (1 + 10 × over)  ·  completion × max(0.1, 1 − 1.5 × over)

Network

Calls between components on the same host stay on loopback and never touch the link. Only traffic that crosses the box's edge — users reaching Nginx, calls out to managed services or other machines — uses the NIC. Each crossing pays the time to move its payload, queued as the link fills:

demand = crossing req/s × payload KB × 8 / 1000   (Mbps)
u = demand / link speed
delay per crossing = (payload KB × 8 / link Mbps) / (1 − u) × max(1, u) ms
completion = 1 / max(1, u)

What each component costs the machine

Server / Container800 req/s per coreCapped at its CPU setting. RAM: its RAM setting.
GraphQL Server3 000 req/s per coreCapped at its CPU cores. RAM: its RAM setting.
Nginx10 000 req/s per coreCapped at its worker processes. RAM: 256 MB. Cache hits never reach the services behind it.
Load Balancer / Proxy10 000 req/s per coreCan use the whole machine. RAM: 256 MB.
API Gateway5 000 req/s per coreCan use the whole machine. RAM: 256 MB.
SQL Database2 000 queries/s per coreCan use the whole machine. RAM: its RAM setting.
NoSQL Database4 000 ops/s per coreCan use the whole machine. RAM: its RAM setting.
In-Memory Cache80 000 ops/s per coreSingle-threaded: never more than 1 core. RAM: its memory setting.
Memcached50 000 ops/s per coreCapped at its thread count. RAM: its memory setting.
Elasticsearch500 queries/s per coreCan use the whole machine. RAM: nodes × RAM per node.
Queues20 000 msg/s per coreMessage Queue, Kafka, RabbitMQ, Pub/Sub. RAM: 256 MB.
Service Workerbusy workers × CPU shareCapped at its worker count. RAM: workers × memory per worker.
Anything else2 000 req/s per coreCan use the whole machine. RAM: 256 MB.

These per-core rates are typical figures for a mixed workload; the CPU-heavy workload type lowers them. If you have measured your own service, set its CPU limit to match.

Managed services inside a host — External Service, CDN, DNS, Object Storage, Mail, LLM, Serverless — run on the provider's machines. They are tagged off-host: calls to them use the host's network, but they take none of its CPU or RAM.

Worked example

A 4 vCPU / 8,192 MB / 1 Gbps VPS running Nginx, an API container (2 cores, 1,024 MB), Redis (1,024 MB), Postgres (4,096 MB) and a queue feeding 4 workers (200 ms jobs, 256 MB each, half CPU-bound). Its RAM is exactly full: 8,192 MB held including the OS. The same design was also run without the host, as if every component had its own machine.

LoadSeparate machinesOn the VPSHost CPU
100 rpsp50 83 msp50 47 ms55% · 1.15× slower
500 rpsp50 85 msp50 56 ms74% · 1.5× slower
1 000 rpsp50 89 msp50 163 ms98% · 5.5× slower
1 500 rpsp50 125 ms · 0% errorsp50 532 ms · 17.5% errors122% · overloaded

At light load the VPS is faster: API, Redis and Postgres talk over loopback instead of paying a network hop between each pair. As load rises they start fighting for cores. The workers are the biggest user from the start — four workers finishing 200 ms jobs can complete only 20 jobs a second, so above that they are always busy, holding 4 × 50% = 2 cores. By 1 500 rps the machine is past its limit and requests fail, while the separate-machines version still looks healthy. Figures come from one run; sampling varies them slightly.

Host settings

vCPUcoresCores the machine has. Every on-host component's CPU demand is summed against it.
RAMMBMemory the machine has. Components' peak memory plus 512 MB for the OS is summed against it.
Link SpeedMbpsThe NIC shared by all traffic entering or leaving the machine. Presets: 100 Mbps, 1 Gbps, 10 Gbps.
Avg PayloadKBOne request plus its response. Turns crossing req/s into Mbps. Default 20 KB.
Scaling out: the host's replicate button adds a second machine beside it with copies of its components and their connections. Put a Load Balancer / Proxy in front of both to see how two smaller boxes compare with one bigger one.

Limits of the model

  • Disk is not shared yet. Each database keeps its own IOPS setting; two databases on one disk don't compete for it.
  • RAM is configured, not measured. A component counts the memory you give it, whether or not traffic would fill it.
  • Network crossings are estimated. A component called from several places has its traffic split evenly over its callers when working out which calls cross the host's edge.
  • It is a model, not a load test. For real numbers, load-test the machine (k6, wrk) and feed the measured job times and limits back into the canvas.

Container Clusters

A Container Cluster box is a container platform. Drop your Container services inside — with Nginx as the ingress if you use one — and each runs between its min and max replicas while the platform places those replicas. One model covers every platform; only where replicas run differs.

Kubernetes (EKS, GKE, AKS, k3s)

Pods on a node pool you size. The scheduler places pods by their requests; the Cluster Autoscaler or Karpenter adds nodes, up to your max, when pods don’t fit.

Amazon ECS on EC2

Tasks on container instances you size. Placement by task CPU and memory, binpack; a capacity provider with managed scaling adds instances.

AWS Fargate (ECS or EKS)

Serverless: each task gets exactly its CPU and memory. Nothing to size, nothing waits for room, no neighbours to contend with.

Google Cloud Run, Azure Container Apps

Serverless the same way, each with its own platform. Scale on requests per replica to match their concurrency-based autoscaling.

Scheduling

On Kubernetes and ECS on EC2, each machine first keeps a little for itself — 0.1 vCPU and 768 MB for the kubelet and system, 0.05 vCPU and 307 MB for the ECS agent. Every replica (and every other component, as one replica sized to its own settings) is then placed by its requests, largest first, on the first machine with room. When none has room and the autoscaler is on, a machine is added, up to the max. Whatever still doesn't fit is pending: it doesn't run, so the service has fewer replicas than its autoscaler wanted — and if none of a component's replicas fit, its requests fail.

allocatable per machine = (vCPU − reserved cpu, RAM − reserved RAM)
place each replica (largest request first) on the first machine with room
no room → add a machine if running < maxNodes, else pending

Contention

Replicas on a node-based cluster share its running machines the way components share a host: their CPU use (each replica up to its limit, never more than one machine) is summed against the machines' allocatable CPU and slows everything on the cluster as it fills. Memory counts at the requested amount. Calls between replicas cross the cluster's network (0.5 ms). On serverless platforms nothing contends: CPU use is shown against what the replicas were given, and a replica that needs more than its size saturates on its own.

Example

A service with requests 1 vCPU / 1,024 MB, limits 2 vCPU / 2,048 MB, 1–2 replicas at 70% CPU, beside a Postgres, on Kubernetes nodes of 2 vCPU / 4,096 MB (1–3, autoscaling): at 300 req/s it runs one replica on two nodes — Postgres and the service don't fit on one; at 900 req/s it scales to two replicas on three nodes; at 3 000 req/s it is capped at two and the nodes run at about 90% CPU. With the pool fixed at one node, the service can't be placed at all and every request fails. On Fargate the same service scales the same way with no machines to run out of.

From your manifests to the canvas

The cluster box is where replicas run; each Container card inside it is one service. Copy these values across.

Kubernetes

Node instance typecluster boxvCPU / RAM per node — e.g. m6i.xlarge → 4 vCPU / 16,384 MB.
Node group min / maxcluster boxMin / Max nodes. Cluster Autoscaler or Karpenter on → Autoscale on.
resources.requests.cpu / memoryContainerCPU Request (500m → 0.5) and Memory Request (Mi → MB as is).
resources.limits.cpu / memoryContainerCPU Limit and Memory Limit. No CPU limit set → use the node's vCPU.
HPA minReplicas / maxReplicasContainerMin / Max Replicas. No HPA → both equal to the Deployment's replicas.
HPA averageUtilization (cpu)ContainerScale On: CPU, Target CPU — e.g. 70.
Ingress controllerin frontingress-nginx → the Nginx component; a cloud load balancer → Load Balancer / Proxy.

Amazon ECS and Fargate

Launch typecluster boxEC2 → platform Amazon ECS on EC2; Fargate → platform AWS Fargate (no instances to size).
Container instance typecluster box, EC2vCPU / RAM per instance — e.g. m6i.large → 2 vCPU / 8,192 MB.
Auto Scaling group min / maxcluster box, EC2Min / Max instances. Capacity provider with managed scaling → Autoscale on.
Container cpu (units)ContainerCPU Request = units ÷ 1024 (512 → 0.5).
Task cpu (units)ContainerCPU Limit = units ÷ 1024. On Fargate, the task size is both request and limit.
memoryReservation / memoryContainerMemory Request (soft) and Memory Limit (hard), MiB → MB as is.
Service Auto Scaling min / max capacityContainerMin / Max Replicas.
Target tracking: ECSServiceAverageCPUUtilizationContainerScale On: CPU, Target CPU.
Target tracking: ALBRequestCountPerTargetContainerScale On: Requests per replica. ECS counts per minute — divide by 60 (1 200/min → 20 req/s).
Application Load Balancerin frontLoad Balancer / Proxy. Its target group spreading over tasks is automatic.
Not modelled yet: ECS on EC2's awsvpc ENI limit (tasks per instance, unless ENI trunking is on), spread and AZ placement strategies or placement constraints (placement is binpack), Fargate's valid size combinations, and how fast scaling happens — HPA sync, task start-up and new machines arriving. The canvas shows where the system settles.
platformkubernetes | ecs-ec2 | fargate | cloud-run | container-appsNames the parts (pods or tasks, nodes or container instances) and switches serverless platforms to no-machines mode.
vCPU / RAMper machineEach node or container instance in the pool. Ignored on serverless platforms.
minNodes / maxNodesmachinesThe pool's floor, and how far the node autoscaler may grow it.
autoscaletoggleCluster Autoscaler / Karpenter / ECS capacity provider. Off keeps the pool at its minimum.

Capacity Finder

Find capacity (the gauge button in the toolbar) answers "how much can this design take?". Set the service level — p95 latency, error rate and optionally p99 — and it finds the highest total load the design serves within it, what breaks first beyond that, and which component or machine is the bottleneck.

start at the clients' current load
meets targets → double until one breaks · misses → halve until they hold
then bisect the gap until it is within 3%

Every client is scaled in proportion, so their share of the traffic stays the same. Each load is a short simulation (about 6 000 sampled requests), so a search takes a second or two; near the limit, results vary by a few percent between searches. Set clients to this load applies the answer to the design, so a full benchmark can be run there.

p95 latencyms95% of requests must finish within this. Default 300 ms.
p99 latencyms, optionalOff by default; when on, 99% must finish within it.
Errors%Share of requests allowed to fail. Default 1%.

Import

Import builds the canvas from the setup you already run. Paste the file, drop it on the panel, or choose it — the panel shows what it will create before anything changes. It opens from three places:

  • The toolbar (upload icon, or ⋯ → Import): into a new Host or cluster box.
  • A Host or Container Cluster's settings → Import into this host / cluster: into that box, below what already runs there; the box grows to fit, and Replace swaps only that box's contents.
  • A service's canvas in a multi-service project: as the toolbar, but without a Users client — a service's callers are other services.
Docker Compose.yml / .yamlA compose file with a top-level services: map. Becomes one Host — the machine compose runs on — with every service it runs inside. Services behind a profile come in (profiles like apps or workers are part of the system) unless the profile is dev-only, such as debug, test or localdb, which are left out and listed. One-off start-up jobs others wait on (service_completed_successfully, e.g. migrations) are left out. ${VAR:-default} values are read with their defaults, so URLs built from variables still connect services.
Kubernetes manifests.yml / .yamlDeployments, StatefulSets, Pods, Jobs, CronJobs, HPAs, Services and Ingresses — several documents separated by ---, or a kubectl get -o yaml List. Jobs come in as Workers and CronJobs as Schedulers. Becomes a Kubernetes cluster.
Amazon ECS.jsonA task definition (describe-task-definition output or the raw definition), optionally with describe-services output in a JSON array. Becomes an ECS cluster — Fargate when the tasks require it.
Google Cloud Run.yml / .yamlServices from gcloud run services describe --format yaml (several separated by ---). Limits, min / max instances from the autoscaling annotations, calls from *.run.app URLs. Becomes a Cloud Run box.
Azure Container Apps.yml / .yaml / .jsonApps from az containerapp show or az containerapp list. Resources, min / max replicas from scale, an external ingress as the way in. Becomes a Container Apps box.

GKE and AKS run Kubernetes, so import them as Kubernetes manifests. Files up to 1 MB; any other file type is refused before it is read. Helm charts and CloudFormation templates need rendering first (for example helm template); their templating tags aren't YAML values. Scale-to-zero and concurrency-based scaling are imported with at least one replica and CPU-based scaling, and the preview says so.

What becomes what

Components

Chosen from the image: nginx → Nginx, postgres / mysql → SQL Database, redis → Redis, mongo → NoSQL, rabbitmq, kafka, elasticsearch; names like worker or celery → Service Worker; anything else → Container.

Sizes and replicas

Compose deploy.resources (or cpus / mem_limit) and deploy.replicas; Kubernetes requests, limits, replicas and the HPA’s min / max and CPU target; ECS CPU units ÷ 1024 and MiB, the task size as the limit, the service’s desired count.

Connections

depends_on and links, plus environment values that name another service — DATABASE_URL=postgres://db:5432 connects to db. Kubernetes resolves Service names; an Ingress or a service’s load balancer becomes the way in.

Safe to re-import

When the canvas already has a design, an import replaces it by default — the Replace / Add switch beside the button says what will be removed — or you can choose to add it beside what's there. Either way it happens as one step, so a single Undo reverses it, and the view zooms to fit the result. If you add a file whose services are already on the canvas, the switch warns that they would be duplicated. An import that keeps the current design connects to the Users client already there rather than adding another, and is placed clear of what's on the canvas. Text pasted into the panel is kept if you close it.

When a file can't be read

The panel says why, and where: invalid JSON or YAML with its line number, a file that is valid but not one of the formats above (with the keys it found), an unrendered Helm or Go template (render it with helm template first), or a file of the right format with nothing to import. Anything it reads but can't fully map — a missing limit, a sidecar, a DaemonSet, an include: of other files — is listed as a note, and the design is still imported. Admin tools, metrics exporters and backup jobs (pgAdmin, Adminer, kafka-ui, *-exporter, backups) are left out: they aren't on the request path. Connections are only drawn when the file is clear about them: depends_on, links, an Ingress or load balancer, or a variable naming a service as a host — a URL's host (postgres://user@db:5432), a host:port, or a host variable (DB_HOST: db). Free text, MODE: web or a public domain like api.stripe.com never connect. When unsure, the line is left out for you to draw; if nothing shows where traffic comes in (no proxy, ingress or published port), Users is left unconnected with a note. Memory comes from the file too: a limit, or what a data store's command sets — Redis --maxmemory, Postgres shared_buffers, MySQL innodb_buffer_pool_size — and a search engine runs as one node per container. A data store with no size gets a modest 512–1,024 MB, with a note. Before you add, the panel shows the RAM the import needs against the machine it runs on, and a new host starts at the smallest usual size that holds it.

Server / VM

CPU performance degrades exponentially as effective RPS per core approaches a saturation threshold (~800 RPS/vCPU). Low RAM adds an additional multiplier from page-fault pressure.

nodeLat += BASE(5ms) × 1.5^(effRPS / (vCPU × 800)) × ramPenalty
CPU Safety Limit

800 RPS per vCPU is the stable zone. Beyond it, context-switching overhead causes non-linear latency spikes.

RAM Penalty

Applies only when RAM < 1,024 MB: penalty = 1.5 / (ram_MB ÷ 1,024). At 512 MB → 3× multiplier; at 256 MB → 6×.

cpuvCPU countSets the per-core RPS ceiling. More cores = linear scaling until memory is the bottleneck.
ramMBBelow 1,024 MB RAM triggers the page-fault penalty multiplier.
connsmax connectionsConnection pool size. Controls saturation threshold via Little's Law.
On a shared host: inside a Host / VPS, the server still has its own CPU and RAM limits, and also draws on the machine's — up to cpu cores and its full ram. When the host runs short, its work slows down along with everything else on the box.

Container

Uses the same exponential CPU model as Server/VM. Containers typically run with fractional CPU shares and low RAM, so the RAM penalty is almost always active at default values (512 MB → 3× multiplier).

nodeLat += BASE(5ms) × 1.5^(effRPS / (cpuShares × 800)) × ramPenalty
cpulimit, coresWhat one replica may use at most (Docker --cpus, a Kubernetes limit, an ECS task's CPU). Sets its 800 req/s-per-core capacity.
ramlimit, MBOne replica's memory limit. Below 1,024 MB the RAM penalty applies. On a plain host it counts fully against the machine.
hitRatio0–1 (Request Absorption Rate)Share of requests passed on to what's behind it. 1 passes everything; 0.2 answers 80% here (early returns, validation, an in-process cache).
cpuRequest / ramRequestcores, MBWhat one replica is scheduled with in a Container Cluster, and what CPU autoscaling measures against. Never above the limit.
minReplicas / maxReplicas1–1 000The autoscaler's range. Both 1 means a single copy, exactly as before scaling existed.
scaleMetriccpu | requestsCPU utilization (HPA, ECS target tracking) or requests per replica (ALB request count, Cloud Run concurrency).
scaleTargetCpu / scaleTargetRps% of request, req/sThe target the autoscaler holds: average CPU as a share of the request, or requests each replica should take.

Replicas and autoscaling

A Container is one service — a Kubernetes Deployment, an ECS service, a Cloud Run service. With a max above 1, the engine works out how many replicas the load calls for, keeps it within min and max, and spreads traffic evenly over them, as a Kubernetes Service or an ECS target group does. The service's capacity is then one replica's capacity times the replicas running.

CPU: replicas = ⌈ (effRPS / 800) / (cpuRequest × targetCpu) ⌉
requests: replicas = ⌈ effRPS / targetRps ⌉
running = min(max(replicas, minReplicas), maxReplicas) — minus any the cluster can't place
capacity = running × cpu × 800 req/s

The card shows 2/2 replicas after a run, in red when the load wanted more than the max or the cluster left some pending. This is the steady state the autoscaler settles at; how fast it gets there (sync interval, start-up time) isn't simulated yet.

Docker on a VPS: drop the containers into a Host / VPS box and set each one's cpu and ram to its compose limits. Their limits may add up to more than the machine has — that is normal in Docker — and the host then shows what happens when they peak together. Replicas on a host each take their own limit from the machine. On Kubernetes or ECS, use a Container Cluster instead.

Serverless Function

Every invocation incurs a cold-start penalty. Higher memory allocation gives proportionally more CPU, so 1,024 MB functions start roughly 2.8× faster than 128 MB functions.

coldStart = (100ms + rand(0–500ms)) / √(memory_MB / 128)
Cold Start Range

100–600 ms at 128 MB. Scales down inversely with the square root of memory allocation.

Hard Timeout

If cumulative path latency exceeds timeout × 1000 ms, the request is dropped as a 504 error.

memoryMB (128–10240)Higher memory = more CPU = faster cold starts and execution.
timeoutseconds (1–900)Absolute ceiling on total path latency. Exceeded → dropped request.

WebSocket Server

Long-lived connections have very low per-message overhead. The main constraint is the total concurrent connection ceiling — once saturated, new handshakes are rejected. Heartbeat adds 0.5 ms overhead only when heartbeatInterval > 0 (i.e. actively configured). Setting it to 0 disables ping/pong entirely.

nodeLat += 1ms + (heartbeatInterval > 0 ? 0.5ms : 0)

Utilisation uses Little's Law directly: concurrent connections ≈ throughput × avg session (30 s). At 1 000 new connections/s with a 30 s session lifetime → 30 000 concurrent, on a 50 000-conn server → 60% load.

connsmax connectionsTotal simultaneous WebSocket clients. Saturation = dropped handshakes.
heartbeatIntervalseconds (0 = disabled)Set to 0 to disable ping/pong. Any positive value adds 0.5 ms per-message overhead.

Service Worker

Models a background worker pool — Node.js worker_threads, Python Celery, Go goroutine pool, Java ExecutorService. Each worker processes one job at a time with a deterministic service time. The engine uses the M/D/1 Pollaczek–Khinchine (P-K) formula: Poisson arrivals, deterministic (fixed) service time — the most accurate closed-form model for a fixed thread pool.

serviceRate = workerCount × (1 000 / jobDurationMs) [jobs/s] ρ = effRPS / serviceRate if ρ < 1 (stable): Wq = ρ × jobDuration / (2 × (1 − ρ)) ← P-K mean wait if ρ ≥ 1 (overloaded): Wq = (ρ − 1) × jobDuration × 2 ← linear backlog divergence nodeLat += jobDurationMs + Wq if backlog > queueDepth → DROP (proportional probability)
4 workers, 100ms job, 100 RPS
ρ = 100 / (4×10) = 2.5
100 + (1.5×100×2) = 400ms
Severely overloaded — queue explodes
4 workers, 100ms job, 30 RPS
ρ = 30 / 40 = 0.75
100 + (0.75×100/(2×0.25)) = 250ms
Healthy but queue building
8 workers, 50ms job, 100 RPS
ρ = 100 / 160 = 0.625
50 + (0.625×50/(2×0.375)) ≈ 92ms
Comfortable — low wait
Memory ceiling: If workerCount × memoryPerWorkerMb exceeds the RAM of the host the workers run on (16,384 MB when they aren't inside a host), the engine clamps effectiveWorkers to fit. At 64 MB/worker the ceiling is 256 workers; at 512 MB/worker only 32 workers run regardless of config.
workerCount1–1024Thread / process pool size. Directly sets serviceRate ceiling.
jobDurationMsms (1–60 000)Average job execution time. Lower = higher throughput per worker. Sets the D in M/D/1.
queueDepth1–100 000Max backlog before jobs are dropped. Drop probability scales with how far backlog exceeds this.
retryEnabledtoggleOn failure, 50% of jobs are retried once. Clears transient errors but adds one jobDuration of latency.
memoryPerWorkerMbMB (16–8 192)Heap per worker. Clamps effective worker count if total exceeds the host's RAM (16,384 MB off a host).
cpuBoundRatio0–1Share of a job spent computing rather than waiting on I/O. On a shared host, busy workers × this is the CPU they take from their neighbours.

Container Orchestrator (legacy)

Replaced: for Kubernetes, ECS or Fargate, use a Container Cluster with scaling on each Container. This component is no longer in the palette; it stays only so existing designs keep working, and its autoscaling settings were never simulated.

Models a cluster of worker nodes managed by a control plane. Throughput capacity scales linearly with node count, CPU per node, and overcommit ratio. It simulates scheduling overhead and optional autoscaling latency.

capacity = nodeCount × cpuPerNode × 800 × overcommitRatio util = effRPS / capacity nodeLat += 5ms + (util > 0.8 ? (util − 0.8) × 50ms : 0)
Overcommit: In cloud environments, CPU is often over-provisioned. A ratio of 2.0 means the orchestrator expects to handle 1600 RPS per physical core by assuming not all pods are peaking simultaneously.
nodeCountnodesNumber of worker nodes in the cluster.
cpuPerNodecoresCompute capacity per node.
overcommitRatiomultiplierCPU over-provisioning factor. Higher = more capacity but higher saturation risk.
autoScalingtoggleWhen enabled, high utilization triggers a 10% pod startup latency penalty.

GraphQL Server

GraphQL introduces a parsing and resolution layer. Performance is sensitive to query depth and the number of underlying resolvers invoked per request.

resolverLat = resolversPerQuery × (dataLoaderBatching ? 1.2ms : 2.0ms) nodeLat += 5ms (parsing) + resolverLat + (maxQueryDepth × 0.5ms)
DataLoader Batching

Reduces resolver latency by 40% by collapsing multiple downstream N+1 requests into single batches.

Query Caching

If queryCacheRatio hits, the entire resolution is skipped, returning in a fixed 2ms.

resolversPerQuerycountAverage number of data fetchers triggered per root query.
maxQueryDepthlayersComplexity ceiling. Deeper queries add recursive overhead.
queryCacheRatio0–1Probability of a whole-query result being served from memory.

Microservice (Nested Service)

A Microservice node represents another private service composed inside this one. It is a black box at this level — but not a static one. The engine recursively simulates the referenced service's full internal canvas at the effective RPS this node receives, so its latency, error rate, and saturation always reflect the real load. See Nested Private Services for the full model.

effRPS = systemRPS × trafficWeight inner = simulate(service.canvas, effRPS) nodeLat += inner.p50 · drop ~ inner.errorRatePct
Request Absorption Rate: when this service internally calls another service, the absorption rate is the probability a request cascades downstream. 1.0 = every request propagates; 0.2 = 80% is absorbed at the edge (cache hits, early returns, validation drops).
hitRatio0–1 (Request Absorption Rate)Fraction of inbound traffic that cascades to internally-referenced services. Lower = more traffic absorbed before reaching downstream services.

API Gateway

The gateway adds a fixed 2 ms routing overhead and enforces rate limits. Requests above the rate limit are immediately dropped and counted as errors — they never reach, or load, the services behind it.

if (rateLimit > 0 && effRPS > rateLimit) → DROP (error)
else nodeLat += 2ms
rateLimitreq/s (0 = disabled)Hard ceiling on accepted RPS. Overflow → error rate increase.
protocolhttp | httpsHTTPS adds +3 ms TLS overhead via the global network physics layer.

Load Balancer / Proxy

Covers both cloud load balancers (ALB, ELB) and reverse proxies you run yourself — Nginx, HAProxy, Traefik, Caddy, Envoy; searching any of those names finds it. It routes each request to exactly one downstream using a weighted random selection. The routing weight depends on the algorithm configured.

round-robin1 (equal)

Each backend gets equal share regardless of capacity.

weighted-round-robinexplicit edge weight, fallback → target CPU cores

If you set a weight on the connection edge, that takes precedence. Otherwise the target's CPU count is used automatically.

weighted-least-connsame as weighted-round-robin

Same weight logic. Approximates least-connections via capacity.

resource-basedcpu + (ram_MB / 4,096)

Combines CPU and RAM to compute a composite capacity weight.

ip-hash / random1 (equal)

Equal probability per backend — hash affinity is approximated as uniform distribution.

Auto-weight example: Load balancer with weighted-round-robin, one target is 32-core "High" and another is 2-core "Standard". No edge weights set → weights become 32 and 2 → High receives 94% of traffic, Standard receives 6%.
Cache-path behaviour: When an LB has a caching connection (isCaching) to a cache node (Redis, Memcached), it acts as a cache-first router. On a cache hit the request stops at the cache. On a miss the LB routes to exactly one backend using the configured algorithm — not all backends simultaneously.
algorithmround-robin | weighted-* | resource-based | ip-hash | randomRouting strategy. See algorithm cards above.
connsmax connections (1 000–1 000 000)Connection pool ceiling. Default 100 000, which suits a managed cloud LB. At high RPS, a low value causes saturation errors.
Running Nginx? Use the Nginx component instead: it sizes its connections from worker processes, and can also cache, rate-limit and act as an API gateway.

Nginx

Nginx in front of your services, in whichever role it plays for you. As a reverse proxy / load balancer it sends each request to one upstream using the chosen algorithm, like the Load Balancer. As an API gateway it routes by the weights set on its connections — one per route — like the API Gateway. In both roles it can answer from its proxy cache, rate-limit and terminate TLS.

maxConnections = workerProcesses × workerConnections
capacity ≈ workerProcesses × 10 000 req/s
cache hit (p = cacheHitRate) → answered by Nginx in ~1 ms, nothing upstream
cache miss → one upstream, by algorithm (proxy) or route weight (gateway)
rateLimit > 0 && effRPS > rateLimit → excess rejected (503)
Proxy cache

With proxy_cache on, the hit rate is the share of requests Nginx serves itself. Only misses reach your API, so a 60% hit rate cuts the API's traffic — and its CPU on a shared host — by 60%.

On a VPS

Inside a Host / VPS, Nginx takes about one core per 10 000 req/s, never more cores than it has worker processes, and 256 MB of RAM.

roleproxy | gatewayReverse proxy / load balancer, or API gateway that routes by connection weight.
algorithmround-robin | weighted | least-conn | ip-hashHow the proxy role picks an upstream. Weighted uses connection weights, else upstream CPU.
workerProcesses1–64nginx worker_processes — usually one per core. Sets throughput and the most cores it takes on a host.
workerConnections128–65 536nginx worker_connections. Times worker processes gives the connection ceiling (2 × 1 024 by default).
protocolhttps | httpHTTPS terminates TLS at Nginx: +3 ms on the hop into it.
cacheEnabled / cacheHitRatetoggle, 0–1proxy_cache. Hits are served by Nginx; only misses go upstream.
rateLimitreq/s (0 = off)limit_req. Traffic above it is rejected and counted as errors.

WAF / Firewall

Deep packet inspection adds latency proportional to the number of active rules. Shallow mode skips payload analysis.

rulesPenalty = log₁₀(rulesCount) × 2ms
nodeLat += (deep ? 8ms : 2ms) + rulesPenalty
Shallow Mode

Header-only inspection. Base +2 ms + rules overhead. Faster but misses payload-level attacks.

Deep Inspection

Full packet reassembly and payload matching. Base +8 ms + rules overhead.

Example: 100 active rules → log₁₀(100) × 2 = 4 ms. Deep mode total: 8 + 4 = 12 ms per hop. 5 000 rules → log₁₀(5000) × 2 ≈ 7.4 ms penalty.

rulesCount10–5000Active WAF rules. Logarithmic overhead (doubling rules does not double latency).
inspectionModeshallow | deepShallow = +2 ms base. Deep = +8 ms base. Both add the rules penalty on top.

DNS Resolver

DNS resolution latency is modelled with a probabilistic cache-hit using a hyperbolic saturation curve. TTL=30 s gives a 50% hit rate; TTL=300 s gives ~91%; TTL=3 600 s gives ~99.2%. This reflects real resolver behaviour better than a linear cap — most of the caching benefit is captured in the first few minutes of TTL.

hitProbability = ttl / (ttl + 30)
if (hit) nodeLat += 0.5ms (local cache)
else nodeLat += 5ms + rand(0–45ms) (upstream lookup)
TTL = 0s

5–50ms

No caching — every request hits upstream resolver

TTL = 30s

~27ms avg

Short TTL, half traffic hits resolver

TTL = 300s

~5ms avg

Default — most traffic served from cache

ttlseconds (0–86400)Record time-to-live. Cache hit probability = ttl / (ttl + 30). TTL=0 forces every request upstream.
failoverEnabledtoggleWhen enabled, a failed primary DNS target retries an alternate route (+5ms failover penalty).

CDN

On every request the CDN rolls a cache-hit against the configured ratio. Hits are served from the nearest edge PoP (fast); misses add a 75 ms origin-pull penalty on top of the 5 ms edge base, giving ~80 ms total on miss.

nodeLat += 5ms (edge base always)
if (rand() ≥ cacheHitRatio) nodeLat += 75ms (origin pull)
cacheHitRatio0–1 sliderProbability of serving from edge. 0.8 = 80% pay only 5 ms; 20% pay 80 ms.
ttlsecondsCache object lifetime. Not directly used in latency — informs what hit ratio to configure.

External Service (SaaS / API)

Models 3rd-party dependencies (Twilio, Stripe, Auth0). These services have their own latency distributions, error rates, and throughput limits outside your direct control.

baseLat = rand() > 0.9 ? p99Ms : p50Ms; if (effRPS > throughputRps) nodeLat += 100ms; // congestion penalty
Circuit Breaker

If error rate exceeds threshold, the CB opens and fails all requests immediately for a 30s cooldown, protecting the rest of your system.

Jitter Distribution

Simulated as a bifurcated distribution: 90% of requests hit p50; 10% hit p99 tail latency.

throughputRpsreq/sThe SLA ceiling. Exceeding this triggers 100ms congestion latency or 30% random drops.
latencyP50MsmsMedian latency. Typical duration for 9 out of 10 requests.
latencyP99MsmsTail latency. Applied to 10% of requests to model network jitter or cold paths.
errorRatePct%Baseline probability of the external service returning an error (e.g. 5xx).

SQL Database

SQL performance is bound by IOPS (disk I/O throughput). Partitioning doubles effective IOPS. RAM above 8,192 MB unlocks a 1.5× buffer-pool bonus (hot pages served from memory). Sharding multiplies total capacity linearly across shard nodes. The utilisation metric uses the same effective IOPS formula as latency — partitioning and RAM bonuses are reflected in both so the load gauge is always consistent.

effectiveIOPS = iops × (partitioning ≠ none ? 2 : 1) × (ram > 8,192 ? 1.5 : 1) × (sharding ? shardCount : 1)
nodeLat += (effRPS / effectiveIOPS) × 20ms
iops100–50 000Disk I/O operations/sec. Primary bottleneck metric for SQL.
ramMB (1,024–262,144)Buffer pool size. >8,192 MB unlocks 1.5× effective IOPS via hot-page caching.
connsmax connectionsConnection pool. Default 100 — typical PostgreSQL/MySQL default.
partitioningnone | range | hashRange/hash partitioning doubles effective IOPS and halves utilisation at the same RPS.
shardingtoggleEnables horizontal sharding. Multiplies effective IOPS by shard count.
shardCount2–256 (shown when sharding on)Number of shards. Each shard independently handles effRPS / shardCount queries.
Postgres on a VPS: inside a Host / VPS box the database also takes about one core per 2 000 queries/s and its full ram from the machine — set ram to what it really holds (shared_buffers plus work memory). Its iops stays its own; disk is not shared between components yet.

NoSQL Database

NoSQL stores are optimized for high write throughput and horizontal scale. Sharding multiplies base throughput capacity by distributing data across nodes.

baseCapacity = 2 000 × (sharding ? shardCount : 1) RPS
nodeLat += (effRPS / (baseCapacity × (ram > 8,192 ? 1.5 : 1))) × 10ms
ramMB (1,024–262,144)In-memory document cache. >8,192 MB gives 1.5× effective capacity.
shardingtoggleDistributes data across multiple shard nodes. Multiplies base capacity by shard count.
shardCount2–256 (shown when sharding on)Default 3. Each additional shard adds 2 000 RPS to total capacity.

Elasticsearch

Search latency decreases with more cluster nodes (parallel shard execution). Low RAM per node causes JVM heap pressure and frequent GC pauses (+10 ms penalty). Utilisation is modelled against a capacity of 1 000 QPS per node — a conservative real-world estimate for mixed search/index workloads on moderate hardware.

nodeLat += (20ms / nodes) + (ram < 8,192 ? 10ms : 2ms)
22 ms
Single-node, adequate RAM
8.7 ms
3-node cluster, default
12 ms
10 nodes but heap-starved
nodes1–50Cluster size. Latency scales as 20/nodes — doubling nodes halves base search time. Capacity = nodes × 1 000 QPS.
ramMB per nodeJVM heap. Below 8,192 MB adds 10 ms GC pressure penalty; above 8,192 MB adds only 2 ms overhead.

Object Storage (S3 / GCS / Azure Blob)

Provider-agnostic object store model. Latency is composed of six additive steps: storage class retrieval tier, auth overhead (standard SigV4 vs. presigned), optional KMS encryption round-trip, Transfer Acceleration edge routing, per-prefix request-rate throttling, and bandwidth saturation. All steps respect the configured workload type (read vs. write).

nodeLat += classLatency (50 | 100 | 150 ms)
nodeLat += presignedUrl ? 0 : 10ms (SigV4 auth)
nodeLat += encryption === 'kms' ? 8ms : encryption === 'sse-s3' ? 1ms : 0
if (transferAcceleration) nodeLat ×= 0.6
prefixCap = prefixCount × (write ? 3 500 : 5 500) req/s
if (effRPS / prefixCap > 1) nodeLat += (sat − 1) × 200ms [+ error risk]
bwSat = (effRPS × 0.1 MB) / throughput_MBs
if (bwSat > 1) nodeLat += (bwSat − 1) × 100ms
throughputMB/s (1–10 000)Bandwidth cap. Assumes ~0.1 MB avg payload per request.
storageClassstandard | ia | glacier-instantstandard: 50 ms. Infrequent Access: 100 ms. Glacier Instant Retrieval: 150 ms.
presignedUrltoggleOff: +10 ms server-side SigV4 validation. On: signing is delegated to the client — 0 ms auth overhead.
prefixCount1–1 000Number of key prefixes. Each prefix handles 5 500 GET/s or 3 500 PUT/s before 503 SlowDown backoff fires.
encryptionnone | sse-s3 | kmsSSE-S3: +1 ms (AES-256 inline). SSE-KMS: +8 ms (extra KMS GenerateDataKey API call).
transferAccelerationtoggleRoutes via nearest CDN edge PoP → private backbone. Multiplies effective latency by 0.6 (40% reduction).

In-Memory Cache

Redis, Valkey, KeyDB, Dragonfly or a managed service such as ElastiCache: anything that speaks the Redis protocol, modelled as one. Name the box after the one you run. It is single-threaded and memory-bound. Its compute cost is negligible (0.5 ms) on top of the network round-trip. Enable sharding (Redis Cluster) to scale throughput linearly across shard nodes — each shard independently handles its key-space slice at the same 50 000 ops/s per 1,024 MB rate.

cap = memory_MB ÷ 1,024 × 50 000 × (sharding ? shardCount : 1) ops/s
util = effRPS / cap
nodeLat += 0.5ms + (util > 0.8 ? (util − 0.8) × 10ms : 0)
At 1,024 MB RAM, single instance handles 50 000 RPS. With sharding enabled and 3 shards, capacity grows to 150 000 RPS — matching Redis Cluster's horizontal scale behaviour.
memoryMB (102–65,536)Determines ops/s capacity: 50 000 × (memory MB ÷ 1,024) per shard.
connsmax connectionsConcurrent client connections. Feeds the global saturation check.
cacheHitRatio0–1 sliderShare of lookups that hit. On a caching connection, only misses reach the origin; with Redis as a step in the path, only misses reach what's behind it. Every lookup, hit or miss, loads Redis.
shardingtoggleEnables Redis Cluster mode. Throughput scales linearly with shard count.
shardCount2–256 (shown when sharding on)Default 3 (matching Redis Cluster minimum). Each shard adds full memory ÷ 1,024 × 50k capacity.
Redis on a VPS: inside a Host / VPS box Redis takes about one core per 80 000 ops/s, but never more than one — its command loop is single-threaded — and its memory (set it to maxmemory) counts fully against the machine's RAM.

Memcached

Memcached is a distributed, multi-threaded, volatile cache. Unlike Redis it has no persistence or complex data structures — just fast key/value storage. Its key advantage is multi-threading: throughput scales with both memory allocation and thread count. Sharding adds further horizontal capacity by distributing keys across independent Memcached nodes (client-side consistent hashing).

cap = memory_MB ÷ 1,024 × threads × 40 000 × (sharding ? shardCount : 1) ops/s
util = effRPS / cap
nodeLat += 0.3ms + (util > 0.8 ? (util − 0.8) × 10ms : 0)
1,024 MB RAM, 4 threads → 160 000 ops/s capacity. Compared to Redis (50 000 ops/s at 1,024 MB), Memcached wins on raw throughput for simple get/set workloads due to multi-threading. Trade-off: no persistence, no data structures, no pub/sub.
memoryMB (102–65,536)Allocated RAM. Capacity = memory ÷ 1,024 × threads × 40 000 ops/s.
threads1–64Worker threads. Default 4. Each thread independently processes requests.
maxItemSizeMB (0.1–128)Maximum cacheable object size. Default 1 MB (Memcached default slab ceiling).
cacheHitRatio0–1 sliderShare of lookups that hit. Only misses reach the origin or what's behind it; every lookup loads Memcached.
shardingtoggleClient-side consistent hashing across multiple Memcached nodes. Multiplies total capacity by shard count.
shardCount2–256 (shown when sharding on)Default 2. Each node runs independently — no cross-node replication.

Time-Series DB

Optimized for append-only streaming writes and window-based reads. It models heavy replication and background downsampling (merging old data points).

effCapacity = (writeRateKps × 1000) / replicationFactor nodeLat += (effRPS / effCapacity) × (downsampling ? 0.6 : 1.0)
Downsampling bonus: Enabling background downsampling reduces read overhead by 40% (0.6x multiplier) by pre-calculating aggregates (min, max, avg) at the cost of disk space.
writeRateKpsk req/sIngestion ceiling. Shared across nodes before sharding.
downsamplingEnabledtoggleReduces read-path latency by using pre-aggregated data windows.

Graph Database

Relies on pointer-following for deep relationship traversals. Latency grows non-linearly with traversal depth (hops) and average node degree (connections per node).

traversalCost = 10ms + degree^(depth / 2) nodeLat += traversalCost + (consistency === ‘strong’ ? 50ms : 0)
Strong Consistency

Adds 50ms sync-penalty to model global lock acquisition or ACID coordination across shards.

Traversal Depth

3 hops = baseline. 5 hops = exponential blowup. High-degree nodes (+20 edges) saturate CPUs rapidly.

avgDegreeedgesDensity of the graph. More edges = more data fetched per hop.
traversalDepthhopsSearch radius. Latency = degree^(depth/2).

Key-Value Store

Models simple O(1) lookups (DynamoDB, etcd, Consul). Highly parallel, deterministic performance intended for transient configuration or distributed locking.

nodeLat += 0.5ms + (consistency === ‘strong’ ? 2ms : 0)
consistencyLeveleventual | strongStrong consistency (like etcd/Raft) adds a 2ms consensus penalty.
evictionPolicylru | lfu | ttlBehavior when RAM is full. Affects utilization metrics only.

Blob Storage

Optimized for large object storage (images, MP4, backups). Unlike the general Object Storage node, it specifically models bandwidth-bound transfer latency with CDN bypass, multipart upload, replication penalties, and storage-class-aware first-byte cost.

transferLat = (5MB × 8) / (maxMbps / 1000) nodeLat += 20ms (metadata lookup) + transferLat
Bandwidth Scaling: While metadata is fast, the bits-in-flight time (assume 5MB avg) dominates. Increasing Max Throughput Mbps directly reduces transfer latency.
maxThroughputMbpsMbpsAvailable network bandwidth. 1000 Mbps = 1 Gbps.

Data Warehouse (Snowflake / BigQuery)

OLAP store for multi-terabyte queries. Columnar storage and massive query parallelism reduce scan times for "Very Complex" analytics jobs.

baseCost = complexityCount [simple=1k, complex=20k] nodeLat += baseCost / parallelismDegree
Columnar Storage

Enabled by default. Optimizes wide-table aggregation by reading only necessary columns from disk.

Query Parallelism

Total workers assigned to one job. 64 parallelism means the compute cost is divided by 64.

parallelismDegreethreadsCompute units dedicated to one query execution.
avgQueryComplexityselectSimple (1s) to Very Complex (60s) base costs.

Kafka / Event Stream

Kafka latency is shaped by partition count (parallelism) and broker count (replication overhead). More partitions reduce per-partition queue depth via log₂ bonus; more brokers add a small ISR sync penalty. Latency is floored at 1 ms — even a massively over-provisioned cluster has serialization overhead.

partitionBonus = log₂(partitions) × 2ms
brokerPenalty = brokers × 0.5ms
nodeLat += max(1ms, 10ms − partitionBonus + brokerPenalty)
3 brokers, 10 partitions

10 − (log₂(10)×2) + (3×0.5) = 10 − 6.64 + 1.5 = 4.9 ms

5 brokers, 100 partitions

10 − (log₂(100)×2) + (5×0.5) = max(1, −0.8) = 1 ms

brokers1–100Broker count. Each broker adds 0.5 ms ISR replication overhead.
partitions1–1000Partition count. Each doubling gives a fixed log₂ reduction in per-message queuing.

Message Queue (SQS)

FIFO queues guarantee exactly-once ordered delivery at the cost of extra coordination overhead. Standard queues trade ordering guarantees for lower latency.

nodeLat += type === ‘fifo’ ? 15ms : 5ms
typestandard | fifoStandard: +5 ms. FIFO: +15 ms (ordering/dedup overhead).
visibilityTimeoutsecondsHow long a message is invisible after being consumed. Does not affect request-path latency.

Pub / Sub

Fan-out adds a per-subscriber delivery scheduling cost to publish latency. 0.5 ms per subscriber reflects the broker's cost of dispatching to each downstream delivery agent.

nodeLat += 3ms + fanoutCount × 0.5ms
fanoutCount1–100Number of downstream subscribers. Each adds 0.5 ms fan-out scheduling overhead.

Mail Server

SMTP is inherently high-latency (TCP handshake + EHLO + DATA phase + server ACK: 100–250 ms baseline). The connection pool queuing follows M/M/c queueing theory — latency diverges sharply as utilisation approaches and exceeds 1.0. Above 1.5× saturation, connections are dropped as errors.

util = effRPS / concurrentConns
baseLat = 100ms + rand(0–150ms)
if (util > 1) baseLat += (util − 1)² × 500ms
if (util > 1.5 && rand() < 0.4) → DROP (error)
concurrentConns1–500Maximum simultaneous SMTP sessions. Queuing diverges above 100% utilisation; errors above 150%.
dailyLimitmessages/dayGradual throttling kicks in at 10× fair-share per second. At 100× fair-share, 50% drop probability.
protocolsmtp | imap | pop3Protocol label for documentation. SMTP overhead is uniform across variants in simulation.

RabbitMQ

An AMQP broker implementing smart-routing via exchanges. Performance depends on persistence settings, acknowledgment modes, and the total consumer pool size across all queues.

nodeLat += 2ms + (manualACK ? 3ms : 0) + (persistence ? 5ms : 0) cap = consumerCount × 5000 msgs/s if (util > 1) nodeLat += (util − 1) × 20ms
Smart Routing: RabbitMQ handles logical exchange-to-queue routing. Each consumer is assumed to process 5,000 messages/second baseline capacity. Manual ACK modes add round-trip overhead to the delivery path.
consumerCountcountTotal workers pulling from the queue. Multiplies throughput capacity.
acknowledgmentModeauto | manualManual ACK adds 3ms per-message coordination latency.
persistenceEnabledtoggleDurable queues add 5ms disk-sync latency to the publish path.

Scheduler (Cron / Job Runner)

Models a background task scheduler. Unlike the Service Worker (which focuses on thread pooling), the Scheduler focuses on long-running jobs and concurrent execution limits. It follows a variation of Little's Law for queueing wait times.

load = (effRPS × jobDurationMs / 1000) / maxConcurrentJobs nodeLat += jobDurationMs + (load > 1 ? (load − 1) × jobDurationMs : 0)
Concurrency Limit: If the total work (RPS × duration) exceeds available concurrency slots, jobs start queueing linearly. A 500ms job on a 10-job server at 40 RPS results in (2.0 - 1) × 500 = 500ms extra wait.
maxConcurrentJobscountMaximum simultaneous tasks. Throughput ceiling = concurrency / duration.
avgJobDurationMsmsMean execution time per task. Determines how quickly concurrency slots are freed.
cronResolutionSecsecThe granularity of the clock (e.g. 60s for standard crontab). Informational.

LLM / AI Model

LLM latency is dominated by token generation speed. The engine estimates output tokens as 10% of the context window size and converts generation time to milliseconds.

outputTokens = contextWindow × 0.1
nodeLat += (outputTokens / tokensPerSec) × 1000ms
8 ms
Small context, fast model
4k ctx, 50 t/s
256 ms
Default settings
128k ctx, 50 t/s
1 280 ms
Slow/large model
128k ctx, 10 t/s
contextWindowk tokens (4–1024)Max input context. Proxy for output length (10% assumed as completion).
tokensPerSect/s (1–200)Generation throughput. Primary bottleneck for LLM latency.
temperature0–2 sliderSampling randomness. Does not affect latency in simulation.

Vector Database

ANN search latency grows with vector dimensionality. The index type determines the search algorithm: HNSW (graph-based) is fastest; Flat (brute-force) is slowest.

dimPenalty = dimensions / 512
indexBonus = hnsw ? 0.5 : flat ? 5 : 1 (ivf)
nodeLat += 5ms × dimPenalty × indexBonus
HNSW
7.5 ms
at 1536 dims
IVF
15 ms
at 1536 dims
FLAT
75 ms
at 1536 dims
dimensions64–3072Embedding vector size. Latency scales linearly with dimensions/512.
indexTypehnsw | ivf | flatHNSW: 0.5× penalty. IVF: 1× (baseline). Flat: 5× (brute-force scan).
similaritycosine | l2 | dotDistance metric. Not differentiated in latency; use for documentation.

Embedding API

Embedding generation is a fixed-cost operation whose per-item cost is amortized by batching. Larger batches reduce effective per-request latency.

nodeLat += latencyMs / log₂(batchSize)
batch = 1

Full 50 ms per request (no batch savings).

batch = 128

50 / log₂(128) = 50 / 7 ≈ 7.1 ms per item.

latencyMsms (5–500)Baseline embedding call latency at batch size 1.
batchSize1–2048Items per API call. Higher batch → logarithmically lower per-item latency.

AI Agent / Orchestrator

Agentic workflows call the LLM multiple times per user request. The orchestrator models only its own routing overhead — each downstream LLM call accrues its own latency separately.

strategyPenalty = tree ? 5 : reflex ? 2 : 1
nodeLat += 10ms × avgSteps × strategyPenalty
chain
×1Linear tool calls. 3 steps = 30 ms orchestration overhead.
reflex
×2Feedback loops. Agent evaluates its own output before proceeding.
tree
×5Tree-of-thought: explores multiple reasoning paths in parallel — expensive.
multiStepFactor1–20Average number of LLM tool-call iterations per user request.
strategychain | reflex | treeReasoning strategy. Multiplies step overhead: chain×1, reflex×2, tree×5.

Document Parser / ETL

Document parsing latency grows with chunk size (more data per unit) and shrinks with parallelism.

chunkPenalty = chunkSizeBytes / 512
nodeLat += (25ms × chunkPenalty) / parallelJobs
chunkSizeBytes128–8192Size of each processed chunk. Larger chunks = more work per task = higher latency.
parallelJobs1–100Concurrent workers. Linearly reduces effective per-request latency.

Workflow Engine

Workflow engines (Temporal, n8n, Airflow) persist state at every step, adding a fixed 10 ms checkpoint overhead. Queuing latency activates above 80% concurrency saturation and grows as the overflow portion using an M/D/1 model (fixed service time, variable arrival). The penalty is (sat − 0.8) × 25ms — only the overflow fraction is penalised, not the full saturation value.

nodeLat += 10ms (state persistence overhead)
execSaturation = effRPS / concurrency
if (execSaturation > 0.8) nodeLat += (execSaturation − 0.8) × 25ms
Utilisation uses Little's Law: active executions ≈ throughput × avg workflow duration (capped at 10 s). At default concurrency of 50: 100 RPS × 10 s / 50 slots = 20× over-subscribed → 2000% → clamped to 100%. At 2 RPS × 10 s = 20 active / 50 slots → 40% utilisation.
concurrency10–5000Maximum simultaneous workflow executions. Above 80% triggers overflow queuing penalty.
timeoutseconds (1–3600)Per-step execution ceiling. Long steps may cascade into downstream timeouts.
retryPolicytoggleAuto-retry on step failure adds 50 ms retry overhead but clears transient errors.