Skip to main content

Reference Benchmarks

These benchmarks are from our internal load tests. Your results will vary based on hardware, network, and workload mix. Run the load testing suite on your own infrastructure for accurate numbers.

Local Development Benchmarks

Tested on a MacBook Pro (M-series, shared CPU), Strait running with DB_MAX_CONNS=50, WORKER_CONCURRENCY=25, PostgreSQL and Redis co-located. These numbers represent a floor, not a ceiling. Production deployments on dedicated hardware with DB_MAX_CONNS=100 will achieve significantly higher throughput. Run the load testing suite on your own infrastructure for accurate numbers.

Hardware Sizing Guide

PostgreSQL Tuning

Connection Pool

The most common bottleneck. Strait uses pgx/v5 connection pooling.

Connection Budget

When running multiple Fly machines, the total database connections equals DB_MAX_CONNS * number_of_machines. Ensure your PostgreSQL max_connections exceeds this sum. For example, with DB_MAX_CONNS=100 and 4 machines, you need at least 400 connections on the primary. PlanetScale PostgreSQL supports 1000 connections per primary and per replica by default.

PostgreSQL Server

Redis Tuning

Worker Configuration

Scaling Workers

For horizontal scaling, run multiple worker processes:
Each worker independently dequeues from PostgreSQL using SELECT ... FOR UPDATE SKIP LOCKED, so they naturally load-balance.

Cost Estimation

Compute Cost per 1M Runs

Monitoring Key Metrics

Track these metrics to predict when you need to scale:
  1. Queue depth - If consistently > 0, add workers
  2. DB connection wait count - If increasing, raise DB_MAX_CONNS
  3. Worker CPU utilization - If > 70%, add worker instances
  4. P99 latency trend - If increasing over days, investigate query performance
  5. Memory RSS - If growing linearly, check for leaks

Fly.io Deployment Sizing

For Fly.io deployments:

Running Your Own Benchmarks

Use the included load testing framework with Grafana dashboards for real-time visualization: