Skip to content
All tool news

Tool desk · Updated daily

Tool news·PostHog·

PostHog Details Rust Runtime Fix Behind Faster Feature Flags.

PostHog shared how fixing Tokio and Rayon thread contention cut feature flag p99 latency spikes from 2.5s to under 100ms.

CW

Create With tool desk

1 source checked · 1 min read

ShareLinkedIn
PostHog Details Rust Runtime Fix Behind Faster Feature Flags

PostHog shared an engineering update explaining how it reduced severe latency spikes in its feature flags service by fixing how two Rust crates, Tokio and Rayon, were used together in production. The issue was not database performance or fleet size, but thread oversubscription inside CPU-capped containers, which caused blocking, scheduler throttling, and request slowdowns.

Key details from the update:

  • PostHog said p99 latency spikes dropped from 2.5 seconds to under 100 milliseconds.
  • The team found that calling Rayon's par_iter() directly inside request handlers was blocking Tokio I/O workers.
  • CPU-bound work was moved to rayon::spawn with a tokio::oneshot channel so async workers stayed responsive.
  • Thread counts were budgeted explicitly based on CPU requests, not container limits.
  • A semaphore was added to limit Rayon queue growth during traffic bursts.
  • Small batches were no longer parallelized, avoiding overhead on most requests.
  • An O(n²) dependency graph traversal was replaced with Kahn's algorithm and BFS-based closure logic.
  • PostHog said the service now handles about 13,000 requests per second with p99 latency under 100 milliseconds across 50 pods.

For small business owners and builders, this is a useful example of how performance issues in modern stacks can come from runtime coordination rather than infrastructure scale. Teams building with PostHog or Rust-based services may find practical lessons here for diagnosing latency and improving efficiency.

Sources

1 checked

How we cover tool news: Create With's tool desk drafts these reports with AI from the sources listed above and checks them against those sources before publishing.

Worth passing on?

ShareLinkedIn

Latest tool news

What else changed this week.

All tool news
VercelDigest

What Vercel Shipped in Late October

Vercel shipped quicker static deployments, four AI Gateway models, more free domain choices and new CLI controls in late October. The changes cover developers testing sites…

Vercel

Vercel Adds Submit_feedback to Its MCP

submitfeedback is a new Vercel MCP tool that lets agents and harnesses send bug reports, friction reports and feature requests directly to the Vercel team. Feedback can include…

The Create With Briefing

Don't watch forty changelogs. Read one email.

Every Tuesday: the tool changes worth knowing, real business use cases, and what's on near you. Free, unsubscribe any time.