Skip to content

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

incident.io 17 min read Case study mediumAdept

Who's on call? How we improved schedule rendering performance 2,500x

incident.io's on-call schedule renderer, which computes future shifts on the fly from rotation config, working hours and fair-scheduling rules, became dramatically faster through a series of fixes culminating in a ~2,500x speedup. Earlier wins came from request validation and context cancellation after a runaway 2092 date, replacing repeated linear entry splitting with sorted binary-search insertion (850ms to 100ms, though a Go pointer-copy aliasing bug forced rollbacks), and removing hot-path waste like string weekday comparisons, unused UUID generation, repeated time.LoadLocation and clock-time parsing for about 40% more. The largest gain came from Claude Opus 4.6 building a V2 renderer that avoids iterating every handover, validated by requiring identical output to V1 across the existing test suite and rolled out behind a feature flag with an audit job.

Assumes: Go slices and pointersCPU profiling and flame graphsTime zones and date arithmetic

Related posts

  • How we improved availability through iterative simplification

    GitHub Engineering mediumAdept

    GitHub cut timeouts in its Rails monolith with small, measured changes found through Datadog metrics, Splunk logs and custom MySQL slow-query monitors. Each change was validated with Scientist experiments or rolled out gradually behind Flipper feature flags. Reordering a Command Palette query to look up a user's contributions before filtering by org removed a large IN clause and was 80-90% faster, and batching access checks added another 20-80% and 30-40%. Skipping unneeded authorization filters on a busy redirect endpoint cut tail latency and timeouts. Not every idea paid off: moving sorting into the application was 40-80% slower, so that experiment was dropped.

  • Making fetch happen: Building a general-purpose query and render scheduler

    Datadog Engineering mediumAdept

    Datadog replaced a tangled ~20-parameter dashboard scheduler with separate, general-purpose query and render schedulers used by widgets across the product. The new query scheduler fetches visible widgets immediately and runs ranked offscreen fetches at up to 10 per fixed 2000ms window, pausing when pending fetches pile up. The result was a flatter request distribution and far fewer 429 errors. Rendering now goes through the Browser Scheduling API's postTask, with visible widgets at 'user-visible' priority and offscreen ones at 'background', which cut render count and duration and greatly reduced long tasks during interactions like drag-and-drop.

  • Building On-call: Time, timezones, and scheduling

    incident.io mediumAdept

    incident.io's on-call scheduler computes who is on shift from rotations with working hours, round-robin handovers and overrides, and getting it right depends on being precise about local time, offsets, IANA timezones, instants and durations. The design keeps everything as UTC instants (Postgres timestamptz, Go's time package) and converts to wall-clock time only at the edges or in isolated, well-tested calculations such as working hours. Users wanted schedules shown in their own timezone, and sometimes several at once, rather than the schedule's timezone. Correctness rests on unit-tested building blocks, JSON snapshot tests of schedule evaluations flagged in PRs via danger.js, and a periodic runtime audit job that re-evaluates active schedules against the cached on-call state.

  • Battling database performance

    incident.io mediumAdept

    Intermittent API timeouts at incident.io over two weeks traced back to requests blocking on Go's database/sql client-side connection pool, with no single slow query or pool to blame. The team shipped 24 changes along the way. These included materialised views, new indexes, query rewrites, a one-second lock timeout on transactions, and moving Slack webhook handling onto PubSub. They also built per-operation tracking of connection-hold time using an ngrok/sqlmw middleware and context counters that avoid double-counting inside transactions. The root cause turned out to be an unnecessary transaction wrapped around every Slack modal submission. Many short transactions added together had exhausted the pools, and removing it ended the timeouts.

  • Incident Report: November 25th, 2025

    Railway mediumAdept

    Slow GitHub API calls (about 4x normal p95 latency) during peak hours backed up Railway's Temporal-based task queue, causing workers to run out of memory and crash in a cascading thundering-herd pattern as surviving and newly started workers were overwhelmed by the backlog. Deployments for Free, Trial and Hobby tiers were paused and Pro deploys delayed for roughly two and a half hours, while running services stayed online. Recovery came from increasing worker CPU and memory and fixing worker parameters that made them request more tasks than they could handle. Follow-up measures include an auto-tuning algorithm for worker task intake, more task queue capacity, and removing external API dependencies from critical workflows.

The quest for software engineering knowledge.

Look:
Layout: