Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

incident.io 10 min read Culture mediumAdept

Interning at incident.io: rate limiting, resiliently

incident.io made its rate limiter keep working when its Valkey backing store (Google Cloud Memorystore) is unavailable, instead of failing open. Each pod tracks the top-k busiest traffic gates in local memory and keeps an in-memory budget buffer for them, so it can grant up to its local budget and then deny. A simulation benchmark chose HeavyKeeper over Space-saving because Space-saving lost precision under high-cardinality traffic. The change was validated by killing a local Valkey cluster mid-test and was rolled out gradually by gate risk; a follow-up used a Kubernetes informer to divide the limit by the live pod count so the effective limit didn't become limit × pods. The post is framed as an intern's experience and recruiting pitch.

Assumes: rate limiting basicsRedis/ValkeyKubernetes pods

Related posts

  • 10 Tips for Building Resilient Payment Systems

    Shopify Engineering mediumAdept

    Ten lessons from Shopify's payment infrastructure for keeping payment systems reliable at scale. Start with low timeouts everywhere: about 1s to open a connection and 5s to read, write or query. Use circuit breakers via Semian, keyed per merchant country so one local acquirer outage stays isolated, and reason about capacity with Little's Law. Track the four golden signals, use structured logs with correlation IDs, and make retries safe with idempotency keys. ULID keys cut INSERT time by 50% versus UUIDv4. The rest covers reconciliation anomalies, load testing against a simulated benchmark gateway, checkout throttling, and incident management and retrospectives.

  • Thundering herd of circuit breakers

    Zalando Engineering mediumAdept

    A client's circuit breaker stayed open for hours because its half-open probes hit a service that the HPA had scaled down to three pods. The sparse probes succeeded, the breaker closed, and the withheld traffic arrived at once, queued for over 100 ms per request, timed out and re-opened the breaker. Each cycle lasted only about three seconds, too short for CPU-averaged autoscaling to notice. Zalando found the cycle by exporting OpenTelemetry traces as CSV into a bespoke uPlot visualizer that plots hundreds of traces at once. Suggested fixes are autoscaling on queue depth or concurrency, longer or heavier half-open probes, pre-scaling before the breaker closes, load shedding, and propagating cancellations.

  • Three Mighty Alerts Supporting Hugging Face’s Production Infrastructure

    Hugging Face mediumAdept

    Hugging Face's infrastructure team relies on three alerts to catch problems early. A static-threshold alert on NAT gateway throughput flags cost-relevant egress changes, such as misrouted traffic that skips cheap private paths to object storage; the fix uses Route53 Resolver DNS overrides managed with CDKTF. An end-to-end alert compares ALB request counts with logs archived through a Filebeat → Logstash → Elasticsearch → Parquet/S3 → Glue/Athena pipeline, catching log loss caused by backpressure, schema-detection failures, OOMs and failed archive jobs. The third alert tracks Kubernetes API error rates and rate limiting, which matter because kube-rs controllers manage certificates, node draining and billing.

  • Fixed cadence to seconds: making ClickHouse Cloud autoscaling more reactive

    ClickHouse mediumAdept

    ClickHouse Cloud's vertical autoscaling recommender moved from a fixed timer loop to a controller-runtime based design, so services that hit memory pressure get a recommendation in seconds instead of waiting for the next scheduled pass. Two sources, a slotted periodic sweep and a reactive poller, feed one rate-limited work queue. The queue provides deduplication, exponential backoff, bounded concurrency and leader election without custom code. The reactive signals live in ClickHouse: a materialized view filters breach rows such as soft memory rejections out of the Prometheus metrics firehose into a small TTL'd table ordered by timestamp, which is polled every few seconds with a cheap five-minute window query.

  • What today's software owes to Bronze Age clocks

    PlanetScale mediumAdept

    Leaky buckets, descended from Bronze Age water clocks, remain a cheap admission-control mechanism: a bucket stores only its last level and timestamp, so its current level can be computed lazily as max(0, level_then − drain_rate × elapsed). Shopify's GraphQL API shows the pattern in practice, charging an estimated query cost up front and refunding or charging the difference afterward. Postgres and MySQL lack built-in admission control, unlike Oracle Resource Manager and SQL Server Resource Governor, so PlanetScale's Database Traffic Control adds token-bucket resource budgets to Postgres. Each budget has a server-share refill rate, a burst limit in whole-server seconds, a per-query limit and a maximum concurrent workers setting, with costs estimated from query plans and history. PlanetScale recommends running a new budget in warning mode before switching it to blocking.

The quest for software engineering knowledge.

Look:
Layout: