Raxx · internal docs

internal · gated ↑ index

Reasonator Cost Model

Date: 2026-05-09 UTC Refs: docs/architecture/reasonator/design.md (Decision 1, Decision 8), #1385

All costs in USD/month. Estimates based on May 2026 list prices. Tax not included.


Assumptions


Load Tier Definitions

Tier req/day Effective headlines/day
Low 100 ~1,000
Medium 1,000 ~10,000
High 10,000 ~100,000

At the High tier (100,000 headlines/day at 5/sec), continuous scoring would require ~5.5 hours of compute per day. A single dyno cannot keep up on the sync path at this load — horizontal scale-out or migration to ECS is required.


Standard-2X spec: 1 GB RAM, 2x CPU share, $50/month per dyno.

Load Dynos needed Monthly cost Notes
100 req/day 1 (min-1) $50/month Idle most of the time; min-1 keeps model warm
1,000 req/day 1 (min-1) $50/month ~10 min/day active scoring; single dyno sufficient
10,000 req/day 2–3 (autoscale) $100–150/month Heroku autoscale triggers on queue depth; consider ECS migration at this tier

Additional costs: - Heroku log drain: $0 (uses existing log aggregator) - Papertrail or Sentry: already provisioned (shared cost) - GitHub Actions keep-alive cron: ~5 min/day × 30 days = 150 min/month. At $0.008/min: $1.20/month

Total at 1,000 req/day: ~$51/month

Heroku Performance-M (if Standard-2X is insufficient): $250/month per dyno, 2.5 GB RAM. Overkill for Phase 1. Flag as a fallback if memory pressure is observed under load.


Option B: AWS ECS Fargate

Recommended task size: 2 vCPU, 4 GB RAM (FinBERT headroom + Flask overhead).

Fargate pricing (us-east-1, May 2026): - vCPU: $0.04048/vCPU-hour - Memory: $0.004445/GB-hour

Per-hour cost for 2 vCPU + 4 GB: - vCPU: 2 × $0.04048 = $0.08096/hour - Memory: 4 × $0.004445 = $0.01778/hour - Total: ~$0.0987/hour

Monthly (always-on, 1 task): $0.0987 × 730 = $72/month

Additional: - ALB: ~$18/month (base + LCU) - ECR image storage: ~$1/month - Data transfer: ~$2/month (internal VPC calls) - CloudWatch logs: ~$3/month

Total at 1,000 req/day: ~$96/month

Load Tasks needed Monthly compute Total (with ALB + infra)
100 req/day 1 $72 ~$96/month
1,000 req/day 1 $72 ~$96/month
10,000 req/day 2–4 (autoscale) $144–288 ~$175–325/month

ECS autoscaling responds to CPU utilization; at the High tier, 2-3 tasks handle the load comfortably.

Setup cost (one-time): ~4-8 developer-hours for ECS task definition, ALB, ECR pipeline, IAM roles, VPC peering with Heroku app. Not negligible.


Option C: AWS Lambda (Provisioned Concurrency)

FinBERT cannot run on standard Lambda (cold start = ~30 seconds for model load; memory cap was 10 GB, sufficient for the model but cold start is disqualifying for Pro+ sync path).

Provisioned concurrency eliminates cold starts but costs as much as a running container.

Lambda pricing (us-east-1, May 2026): - Provisioned concurrency: $0.000064646/GB-second - Requests: $0.20 per 1M requests - Duration (provisioned): $0.000064646/GB-second

Configuration for FinBERT: 3 GB memory, max 10 provisioned instances (for Pro+ headroom).

Per provisioned instance per month (always on): - 3 GB × 3600s × 24h × 30d × $0.000064646 = $50.10/month per instance

Total at 1 provisioned instance: $50/month + $18/month (API Gateway) + $1/month (requests) = ~$69/month

Load Provisioned instances Monthly cost
100 req/day 1 ~$69/month
1,000 req/day 1–2 ~$119/month
10,000 req/day 3–5 ~$225–365/month

Lambda costs MORE than Heroku at every load tier for this workload. Lambda's pay-per-use advantage vanishes when provisioned concurrency is required. Lambda is not recommended.


Comparison Summary

Option 100 req/day 1,000 req/day 10,000 req/day Setup effort Ops complexity
Heroku (recommended) $51/mo $51/mo $101–151/mo Low Low
ECS Fargate $96/mo $96/mo $175–325/mo Medium Medium
Lambda (provisioned) $69/mo $119/mo $225–365/mo High High

Scale Trigger: Heroku → ECS

Migrate from Heroku to ECS when both conditions are true for 7 consecutive days: 1. Daily requests exceed 5,000/day. 2. Heroku autoscaler is consistently at 3+ dynos.

At that point ECS Fargate becomes cost-competitive and provides finer-grained CPU/memory tuning. The migration is mechanical because Reasonator is stateless — no database to migrate, just a new deployment target.

Set a Sentry alert at 4,000 req/day as the 7-day countdown trigger.


Phase 1 Budget Commitment

Recommended commitment: 1× Heroku Standard-2X dyno at $50/month.

At the operator-stated goal of Phase 1 (Pro retrospective sentiment, internal testing), 100–1,000 requests/day is the expected load range. A single $50/month dyno handles this comfortably with headroom. Budget impact is minimal.