Connection pooling என்பது பல client requests களுக்கான database connections களின் சிறிய தொகுப்பை மறுபயன்படுத்துகிறது, ஒவ்வொரு request க்கும் புதிய connection திறப்பதற்கு பதிலாக. PostgreSQL connections விலை உயர்ந்தவை (ஒவ்வொன்றும் கணிசமான நினைவக பயன்பாட்டுடன் ஒரு தனி process), எனவே load இன் கீழ் performance மற்றும் scalability க்கு pooling அপরிहार்யம். PgBouncer தரமான pooler ஆகும்.
சிக்கல்: PostgreSQL connections விலை உயர்ந்தவை
Each PostgreSQL connection = a separate OS PROCESS, using ~5-10MB of memory.
✗ Opening a connection has overhead (process creation, auth, setup)
✗ Many connections (e.g. 1000s from a busy app) → huge memory use, contention
✗ Postgres has a max_connections limit (often ~100); exceeding it = errors
→ Opening/closing a connection per request, or holding thousands open, doesn't scale.
