Performance budgets
8 latency budgets p50/p95/p99 quantified · 6 resource budgets (CPU · memory · bundle size · Lighthouse) · 6 regression detection mechanisms · 5 documented improvements last 90 días. Performance que SE MIDE · NO afirmaciones cualitativas marketing.
8 latency budgets · p50/p95/p99
| Component | p50 | p95 | p99 | Current | Action |
|---|---|---|---|---|---|
| WhatsApp webhook processing (full) | <500ms | <2s | <5s | p50 380ms · p95 1.2s · p99 4.1s (2 demo clinics) | Within budget · monitor trend monthly |
| Health endpoint /health | <50ms | <100ms | <200ms | p50 35ms · p95 78ms · p99 142ms | Within budget · cached static response |
| Bot response (LLM inference call) | <2s | <5s | <10s | p50 1.8s · p95 4.2s · p99 8.7s | Within budget · OpenAI gpt-4o-mini optimization · streaming planned Q3 |
| DB query (single tenant read) | <20ms | <100ms | <300ms | p50 12ms · p95 67ms · p99 220ms | Within budget · Supabase optimization + indexes ready |
| Admin dashboard page load (TTFB) | <200ms | <800ms | <2s | p50 180ms · p95 650ms · p99 1.7s | Within budget · Cloudflare Pages edge cache |
| Cal.com availability check | <300ms | <1s | <3s | p50 250ms · p95 870ms · p99 2.4s | Within budget · external dependency · circuit breaker active |
| Stripe webhook processing | <200ms | <500ms | <1s | p50 150ms · p95 380ms · p99 720ms | Within budget · simple idempotent processing |
| End-to-end message resolution (P0) | <3s | <8s | <15s | p50 2.7s · p95 6.8s · p99 13.4s | Within budget · improvement target Q3 streaming -30% p95 |
6 resource budgets
| Resource | Limit | Current | Action |
|---|---|---|---|
| Cloudflare Worker CPU time | 50ms p95 (free plan limit) | p95 38ms | Within budget · NO worker timeouts last 90d |
| Cloudflare Worker memory | 128MB max per request | p95 42MB · p99 87MB | Within budget · NO OOM kills |
| Cloudflare Worker requests/min | 100k/min (plan limit) | Peak 850/min observed | Massive headroom · plan scales 10x current usage |
| Bundle size landing-next deployed | <1MB first load JS gzipped | ~340KB first load JS gzipped | Within budget · Next.js 16 tree-shaking + code splitting |
| Lighthouse Performance score landing | >90 mobile · >95 desktop | Mobile 94 · Desktop 98 (last measure 2026-05-15) | Within budget · monthly Lighthouse CI audit |
| Cumulative Layout Shift (CLS) | <0.1 (Core Web Vital good) | 0.02 measured · excellent | Within budget · all images aspect-ratio reserved |
Regression detection · 6 mechanisms
- Pre-merge · build size diff vs main · alert si bundle grows >10% · investigate before merge
- Pre-merge · Lighthouse CI runs critical pages · regression si score drops >5 points · blocking merge
- Post-deploy · synthetic monitoring 60s polls · alert si p95 latency >budget for 5+ minutes
- Daily · production p50/p95/p99 metrics report · trends week-over-week · investigate sustained drift
- Weekly · cost-per-request metric · alert si trending >25% week-over-week · investigate root cause
- Monthly · performance review meeting · founder alone pre-tracción · with team post-tracción · documented improvements queue
Improvement history · 5 documented wins last 90d
| Date | Component | Before | After | Change |
|---|---|---|---|---|
| 2026-05-10 | Bot response p95 | 5.2s | 4.2s (-19%) | OpenAI gpt-4o-mini migration from gpt-4-turbo · cost -60% bonus |
| 2026-04-22 | DB query p95 | 120ms | 67ms (-44%) | Composite index added on (clinic_id, created_at) · query plan improved |
| 2026-04-15 | Webhook processing p95 | 1.8s | 1.2s (-33%) | Removed sync Cal.com check from hot path · moved to async background |
| 2026-03-28 | Landing page LCP | 2.4s | 1.6s (-33%) | Hero image WebP + AVIF · Next.js Image component optimization |
| 2026-03-12 | Admin dashboard TTFB | 1.1s | 650ms (-41%) | Cloudflare Pages cache headers tightened · stale-while-revalidate |
Métricas actuales basadas en 2 demo clínicas con volumen bajo (~50-200 mensajes/día each). p95/p99 estadísticamente noisy con tan poco volumen. Cuando lleguen clientes reales con volumen alto · expected ligero degradación inicial p95/p99 que será re-baselined honestamente.
Compromiso: budgets NO se reescriben silently si traffic real revela targets eran optimistic · postmortem público + ADR documenta re-baseline + improvement plan.
¿Tu performance team necesita detailed metrics?
Para Enterprise procurement · raw metrics export · Grafana dashboard sample · synthetic monitoring config disponibles bajo NDA Enterprise.