PgBouncer

Tech Optimizer
February 19, 2026
OpenAI has scaled PostgreSQL to support over 800 million active users of ChatGPT, making it one of the largest PostgreSQL deployments globally. The database can handle millions of concurrent connections and a very high volume of requests per second. OpenAI employs several strategies to optimize performance: 1. **Connection Pooling with PgBouncer**: Reduced database connections from 10,000 to 200, enhancing efficiency by a factor of 50. 2. **Read Replicas**: Distributes read requests across multiple replicas while the primary database handles writes. 3. **Horizontal Sharding**: Partitions data across multiple instances based on a shard key, such as user_id or tenant_id. 4. **Query Optimization**: Analyzes slow queries and creates appropriate indexes to maintain performance. 5. **Connection Management**: Implements timeouts and connection limits to prevent overload. 6. **Caching**: Uses application-level caching with Redis to reduce database load. 7. **Monitoring and Observability**: Tracks key metrics like connection counts and query latency to identify issues early. These strategies enable OpenAI to maintain performance and reliability for a large user base.
Tech Optimizer
February 12, 2026
OpenAI scaled PostgreSQL to handle millions of queries per second for its ChatGPT service and API, serving 800 million users. Collaborating with Azure, they optimized deployment on Azure Database for PostgreSQL, maintaining a single-primary instance with nearly 50 geo-distributed read replicas to manage read operations and keep latency low. Key optimizations included increasing instance size, refining query patterns, and directing write-heavy workloads to sharded systems like Azure Cosmos DB. OpenAI faced operational challenges such as cache-miss storms and complex multi-table joins, which they addressed by shifting tasks to the application layer, enforcing stricter timeouts, and refining query structures. They reduced write pressure on PostgreSQL by migrating shardable workloads, implementing rate-limiting, and utilizing connection pooling with PgBouncer. Future strategies include exploring cascading replication to alleviate the primary instance's load and assessing sharded PostgreSQL deployments to enhance scalability while balancing consistency and performance.
Tech Optimizer
January 26, 2026
OpenAI has optimized its database infrastructure using PostgreSQL to support 800 million monthly active users and process over a million queries per second without complex sharding. The architecture consists of a single primary instance with nearly 50 read replicas, achieving low double-digit millisecond response times at the 99th percentile. OpenAI employs best practices like connection pooling, query optimization, and strategic indexing, utilizing tools such as PgBouncer for efficient connection management. The company has achieved five-nines availability through failover mechanisms and has adapted to a tenfold increase in query volume within a year by tuning PostgreSQL parameters rather than creating custom solutions. OpenAI incorporates community-driven optimizations, such as custom indexing strategies and materialized views, and uses extensions like pgvector for managing vector data and embeddings. The organization continuously monitors for strain during traffic surges and adjusts by adding replicas or optimizing configurations. Their approach emphasizes simplicity, avoiding sharding to minimize operational overhead, and they plan to explore newer PostgreSQL features and AI-native capabilities in the future.
Tech Optimizer
October 8, 2025
OpenAI utilizes PostgreSQL as the backbone for its essential systems, particularly in collaboration with Microsoft Azure Database for PostgreSQL. Initially, OpenAI adopted a straightforward architecture with a single primary Postgres instance for write operations and multiple read-only replicas for handling read traffic. This setup allowed for exceptional scalability in read operations, but as demand increased, write requests became a bottleneck. To address scalability challenges, OpenAI implemented several strategies, including offloading write workloads, optimizing read-heavy workloads with replicas and smart query routing, and establishing schema governance for stability. These optimizations led to significant outcomes: the PostgreSQL cluster now processes millions of queries per second, has numerous global read replicas for low-latency access, and has improved database response times from approximately 50 milliseconds to under five milliseconds for many queries. OpenAI's collaboration with Azure Database for PostgreSQL facilitated ease of scaling and replication, allowing for the seamless addition of replicas and the development of features like elastic clusters and cascading read replicas. The advantages of Azure included high availability, co-innovation support, and security compliance, providing a reliable foundation for OpenAI's optimizations.
Tech Optimizer
September 11, 2025
PgEdge has launched pgEdge Enterprise Postgres, a PostgreSQL distribution designed for enterprise needs, along with a transition of its distributed Postgres components to an open source licensing model. The distributed components, including Spock, Large Object Logical Replication (LOLOR), and Snowflake Sequences, are now licensed under the PostgreSQL License and available on GitHub. PgEdge Enterprise Postgres includes features such as high availability, support for PostgreSQL versions 16, 17, and 18, and enterprise-ready extensions like pgAudit and pgBackrest. Deployment options include native packages, containerization for Kubernetes and Docker, and managed services through PgEdge Cloud.
Tech Optimizer
September 11, 2025
pgEdge has launched pgEdge Enterprise Postgres and transitioned all its Distributed Postgres components to an open source licensing framework under the standard PostgreSQL License. The new pgEdge Enterprise Postgres supports both distributed and non-distributed PostgreSQL applications and includes features such as high availability, support for PostgreSQL versions 16, 17, and soon 18, and enterprise-ready extensions. The product is available in VM Edition immediately and will have a Container Edition launching in Q4. It is compatible with various operating systems, with additional support services available.
Tech Optimizer
September 10, 2025
pgEdge has launched pgEdge Enterprise Postgres and transitioned to an open source licensing model for its distributed PostgreSQL components. The company is expanding its offerings to support both distributed and non-distributed applications based on standard PostgreSQL. Key features of pgEdge Enterprise Postgres include high availability for various workloads, support for PostgreSQL versions 16, 17, and 18, enterprise-ready extensions, management and monitoring capabilities via pgAdmin, and distributed-ready components. All Distributed Postgres components are now fully open source under the PostgreSQL License, including the Spock, LOLOR, and Snowflake extensions. pgEdge Enterprise Postgres VM Edition is available through a paid subscription, and the Enterprise Container Edition will launch in Q4. The company supports various operating systems and offers optional services, with a high Net Promoter Score from clients. pgEdge's clientele includes enterprises like Bertelsmann, Qube RT, Jobot, and the European Parliament, and it is backed by investors such as Akamai Technologies and Rally Ventures.
Tech Optimizer
September 10, 2025
pgEdge has launched pgEdge Enterprise Postgres, designed for enterprise-grade reliability and manageability, compatible with PostgreSQL versions 16, 17, and the upcoming version 18. Key features include high availability, comprehensive support, enterprise-ready extensions (pgAudit, pgBackrest, pgBouncer, PostGIS, pgVector), flexible management options via pgAdmin, and diverse deployment options (virtual machines, Kubernetes, OpenShift, Docker). Additionally, pgEdge has transitioned all its distributed Postgres components to an open source licensing model under the PostgreSQL License, including projects like the Spock multi-master logical replication extension and Large Object Logical Replication (LOLOR) extension, now available on GitHub. The pgEdge Enterprise Postgres VM Edition is available through a paid subscription, with a container edition launching in Q4. Optional services include dedicated Forward Deployed Engineer support, with a Net Promoter Score of 100 for support services.
Tech Optimizer
June 2, 2025
Alexey has developed the pgpro-otel-collector, an OpenTelemetry collector by PostgresPro, designed to gather metrics and logs from PostgreSQL databases. It collects PostgreSQL metrics using an internal metrics library, OS-level metrics such as CPU and memory usage, and PostgreSQL logs in CSV and JSON formats. The collector includes internal processors for batch processing and supports exporting to OTLP-compatible backends like Elasticsearch and Prometheus. Installation is straightforward, requiring configuration of the Postgres connection and data destination. The collector can gather a range of PostgreSQL statistics and supports advanced features like CFS and pg_wait_sampling. Future enhancements include support for additional system views, integration with Shardman and BiHA, collection of custom query-based metrics, and a Grafana dashboard. Alexey's background includes experience with various monitoring tools and a focus on PostgreSQL, leading to the creation of this collector.
Tech Optimizer
March 18, 2025
pgactive enables rolling major version upgrades for Amazon RDS for PostgreSQL, allowing for a smoother transition with reduced impact on applications. Amazon RDS supports both minor and major version upgrades, with minor upgrades being backward-compatible and major upgrades introducing non-backward-compatible features. Downtime during minor upgrades can be minimized using Amazon RDS Proxy or PgBouncer. For major upgrades, a blue/green deployment option is available, which involves provisioning a new DB instance and validating the upgrade. The pgactive extension allows for active-active replication, enabling all nodes to handle read and write operations simultaneously. It includes features like conflict detection and resolution. Key benefits of using pgactive for database upgrades include multi-tenant support, minimal downtime, and seamless rollback capabilities. To perform a major version upgrade using pgactive, the process involves setting up source and target databases, configuring pgactive parameters, and verifying data replication. Specific commands are provided for creating and modifying databases, setting up user mappings, and initializing the replication group. Limitations of pgactive include handling sequences, materialized views, DDL replication, existing logical replication, and tables without primary keys. Monitoring replication lag is crucial for diagnosing potential issues, and alerts should be set up for active status and pending WAL files. In case of a rollback, the application can be pointed back to the old primary database. After the upgrade, resources should be cleaned up to avoid incurring charges.
Search