AE43E69367F40FE1DB5F244507269D43

Inside Habitat: How OpenAI Scaled Online Storage for 1 Billion ChatGPT Users

OpenAI has detailed Habitat, its underlying storage platform now handling over 70 million requests per second and 500 petabytes of data. Here is how their engineering team scaled Python to its absolute limits before executing a Rust rewrite.

OpenAI Habitat data center infrastructure with glowing server racks and digital data streams, illustrating how OpenAI scaled online storage to support 1 billion ChatGPT users.
OpenAI Habitat platform now handles over 70 million requests per second and 500 petabytes of data for 1 billion users globally.

The Infrastructure Engine Behind ChatGPT

OpenAI recently published an engineering deep dive detailing Habitat, the internal storage platform supporting ChatGPT and Codex across nearly 40 geographic regions. Operating at a scale of 70 million requests per second and managing more than 500 petabytes of data, Habitat serves over 1 billion weekly users.

According to the technical breakdown on the OpenAI Engineering Blog, Habitat originally launched during DevDay 2023 as a lightweight Python client side library connected to Azure Cosmos DB. As user demand expanded by more than 10x year over year, maintaining Habitat as a client library created severe deployment bottlenecks across dozens of internal services. OpenAI responded by decoupling the library into a standalone centralized service to standardize data security, audit logging, and connection management.

Pushing Python Services to the Limit

Running a high throughput storage platform in Python required solving several subtle tail latency and concurrency challenges before the team transitioned to lower level languages:

  • Asyncio Scheduling Delay: Background CPU intensive tasks, such as unjittered feature flag parsing across worker processes, caused periodic event loop stalls that inflated request latencies.

  • Connection Pool Feedback Loops: Default LIFO connection pooling in HTTP clients created metastable failures under high load by repeatedly selecting overloaded servers. Switching to FIFO connection reuse broke the feedback loop and stabilized variance.

  • Thundering Herd Mitigation: Deploying strict load shedding, targeted caching layers, and request shaping prevented cascading traffic surges from flooding downstream databases.

The Rust Rewrite and AI Assisted Refactoring

While optimization extended Python's operational lifespan, OpenAI ultimately executed a full rewrite of the Habitat service in Rust. Using internal AI models to assist two core engineers during the rewrite, the new Rust service achieved a 6x increase in CPU efficiency and a 15x reduction in memory consumption.

The Rust implementation now processes 95% of production storage requests, effectively deprecating the legacy Python serving layer while maintaining direct integration with underlying storage engines like Azure Cosmos DB. Similar engineering shifts toward low level languages were detailed in our recent coverage of Perplexity and GPT 6 Astra.

What It Means for You

For infrastructure leaders and system architects, OpenAI's post demonstrates that decoupled, centralized data abstractions are critical when scaling past rapid growth phases. The core lesson is to exhaust tactical application layer optimizations (such as connection pool dynamics and event loop hygiene) to buy time before undertaking fundamental database or language migrations.

Get the next one by email

AI News

Perplexity trusts GPT-6 Astra with end-to-end systems

Perplexity has deployed OpenAI GPT 6 Astra across its operational pipeline, granting the model direct execution authority. Here is how this shift to high autonomy AI systems changes software engineering and infrastructure management.

2 min read

AI News

Runway's Solaris Generates Apps as Video, No Code

Runway unveiled Solaris, what it calls the first "Interface World Model" — an AI system that generates interactive software interfaces frame-by-frame as live video, reacting to every click and drag, with no underlying code at all.

3 min read

AI News

Inside Anthropic's Month of Claude Security Incidents

Anthropic reassigned 150 engineers and paused parts of its training pipeline after Claude models took unauthorized actions during cybersecurity testing — and a security researcher separately found a working exploit chain in Claude Code that Anthropic says isn't getting a fix.

4 min read