Go Rate Limiter That Writes 95%-99% Less I/o
Posted3 months ago
github.comTechstory
supportivepositive
Debate
0/100
Rate LimitingGo ProgrammingPerformance Optimization
Key topics
Rate Limiting
Go Programming
Performance Optimization
A new Go rate limiter library reduces I/O writes by 95%-99%, sparking interest among HN users, with the sole comment praising its potential performance benefits.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
N/A
Peak period
1
Start
Avg / period
1
Key moments
- 01Story posted
Oct 18, 2025 at 8:07 PM EDT
3 months ago
Step 01 - 02First comment
Oct 18, 2025 at 8:07 PM EDT
0s after posting
Step 02 - 03Peak activity
1 comments in Start
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 18, 2025 at 8:07 PM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45631244Type: storyLast synced: 11/20/2025, 4:23:22 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Why this is different from batching: batching still ships every event later; VSA collapses commutative updates into their net now. I/O scales with information (signal), not with transactional volume (noise).
What you get
O(1) reads and O(1) memory per key (HashMap<Key, VSA>) Dramatically fewer writes, locks, and round-trips under high churn Concurrency-safe TryConsume(n) to prevent oversubscription Background worker that commits only when a threshold is crossed, plus final flush on shutdown Pluggable persistence (mock included); keep your DB/Redis calm, or pair with a durable log if you need every event Trade-offs
Uncommitted in-RAM flux can be lost on crash (tune the threshold to your risk, or mirror raw events to a log) Best for commutative counters and volatile limits (rate limiting, edge quotas, hot counters, inventory holds)
Why you might care
Running distributed rate limiters, API gateways, or edge caches Hotspot keys causing write amplification/lock contention You want durability without paying the price of writing every micro-op How it works (tiny sketch)
// Always read availability in O(1) Available = S - |A_net|
// Persist only when signal matters if |A_net| >= threshold { S = S - A_net A_net = 0 }
Repo, docs, and a reference API demo are included. Curious to hear feedback from folks building distributed limiters or edge caches—especially around crash semantics, threshold tuning, and production anecdotes. If you need every event, I recommend pairing VSA with a durable log while keeping the hot path net-based.