#concurrency
3 posts
The 10ms Tick Under Pingora
Cloudflare's nginx replacement burns through millions of timeouts a second, most of which never fire. Their fix: round every deadline to the next 10ms, share one timer across everyone waiting for that slot, and let a single background thread sweep the whole thing. Result: timeouts that cost 4 nanoseconds instead of 107.
How Postgres Prevents Both Deadlock AND Livelock in Upserts
A one-line rule buried in PostgreSQL's INSERT ... ON CONFLICT code prevents two of the nastiest concurrency bugs at once: the transaction with the higher XID backs out.
How nginx Tells Time Without Asking
A lock-free time cache lets millions of nginx requests read the current time without waiting for each other. 64 pre-allocated slots, a memory barrier, and a bet that your thread won't sleep for a full minute.