Scaling PostgreSQL to power 800 million ChatGPT users

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single primary Azure PostgreSQL instance with nearly 50 read replicas across multiple regions. Key optimizations included offloading reads to replicas, migrating write-heavy workloads to sharded systems like CosmosDB, implementing PgBouncer for connection pooling, deploying cache locking to prevent cache-miss storms, isolating workloads to prevent noisy neighbor issues, and enforcing strict rate limiting. The architecture achieved five-nines availability with low double-digit millisecond p99 latency despite PostgreSQL's MVCC limitations for write-heavy workloads.

•12m read time•From openai.com
Post cover image
Table of contents
Cracks in our initial designScaling PostgreSQL to millions of QPSResults and the road ahead
11 Comments

Sort: