Skip to main content

Cost and Capacity

This page documents the cost controls visible in the non-GPU repositories. It does not quote a monthly bill or provider-unit price: those values change and must come from the billing consoles for the same reporting period.

Cost-bearing pathsโ€‹

PathPrimary meterRepository control
Video uploadStorage bytes and operations2 GB request cap, owner-only paths, short-lived handoff URLs
Job orchestrationFunction invocations, runtime, task deliveryentitlement gate, daily/monthly/concurrent quotas, bounded retries
Firestorereads, writes, listenersowner-scoped queries, server-only job writes, batched retention
Reports and exportsStorage and function runtime30-day completed-job retention, 7-day export retention
Public API/MCPdownloaded bytes, processing, function runtimeAPI-key balance reservation and per-key rate buckets
Email/notificationsextension/provider volumeserver-only mail queue and event-driven sends

Inference-provider cost is intentionally outside this audit. Correlate its billing data with Firestore job IDs rather than copying an estimate into this page.

Enforced limitsโ€‹

  • requestUploadPath requires an active entitlement or trial and enforces the user's monthly analysis allowance.
  • Upload quotas are reserved atomically. The current plan-key defaults are free/trial 5 per day, 1 concurrent, pro 50/3, and team 200/5.
  • A failed or terminal job releases its concurrency slot idempotently.
  • Cloud Tasks dispatch has three attempts with a 10-to-120-second backoff and five concurrent dispatch workers.
  • reconcileStuckJobs prevents abandoned jobs from holding quota forever.
  • Completed job artifacts are eligible for purge after 30 days; generated account-export bundles after seven days.

These are code defaults, not a promise to customers. Product entitlements also include tier/monthly limits and can be more restrictive.

Capacity checks before a launchโ€‹

  1. Read current Firebase, Google Cloud, email, and external-provider billing dashboards for the same date range.
  2. Count accepted, failed, retried, and completed jobs by source.
  3. Compare Storage growth with the scheduled retention logs.
  4. Inspect quota rejections and task retries; a lower bill caused by rejected traffic is not healthy capacity.
  5. Load-test only in an isolated project with explicit spend limits.

Alerts worth maintainingโ€‹

  • spend-budget notifications in Google Cloud Billing;
  • sustained growth in pending, uploaded, or processing jobs;
  • task retry/exhaustion and function error rate;
  • upload-quota rejection rate;
  • retention sweep failures or a growing expired-artifact backlog;
  • public API balance-refund failures.

Thresholds belong in the monitoring configuration and incident runbooks. Do not present planning thresholds as observed production baselines.

Source of truthโ€‹

  • Firebase and Google Cloud consoles: actual usage and spend.
  • acesense-auth-function/shared/config.ts: upload and retention constants.
  • acesense-auth-function/shared/quota.ts: atomic quota accounting.
  • acesense-auth-function/video/reconcile.ts: stale-job policy.
  • acesense-auth-function/api/billing-meter.ts: public API metering.

See Observability for investigation paths.