PostgreSQL Connection Pooling #3
butschster
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Executive Summary
Problem Statement
RoadRunner currently spawns multiple PHP workers, each creating independent database connections to PostgreSQL. This architecture leads to:
Proposed Solution
Create a native RoadRunner plugin that acts as a PostgreSQL connection pooler and proxy. PHP workers connect to RoadRunner's local pool instead of directly to PostgreSQL. The plugin manages a shared pool of database connections, multiplexing requests from all workers through fewer backend connections.
Expected Impact
Technical Requirements
Core Functionality
Connection Pooling
Connection Modes
Protocol Support
Configuration Structure
PHP Integration Requirements
Connection Methods
localhost:5433DATABASE_URLto point to local proxyCompatibility Requirements
Performance Targets
Latency Requirements
Throughput Requirements
Resource Limits
Implementation Dependencies
Required Go Packages
Primary PostgreSQL Driver
github.com/jackc/pgx/v5
Supporting Packages
Protocol Implementation
github.com/jeroenrinzema/psql-wire (Alternative approach)
RoadRunner Integration Packages
Monitoring and Observability
Operational Requirements
Health Checks
SELECT 1or pg_is_in_recovery()Graceful Operations
Error Handling
Security Considerations
Migration Path
Phase 1: Basic Pooling (MVP)
Phase 2: Protocol Proxy
Phase 3: Advanced Features
Phase 4: Production Hardening
Success Metrics
Functional Success
Performance Success
Operational Success
Testing Requirements
Unit Tests
Integration Tests
Load Tests
Compatibility Tests
Documentation Requirements
User Documentation
Developer Documentation
Acceptance Criteria
The plugin will be considered complete when:
References
Beta Was this translation helpful? Give feedback.
All reactions