- Published on
Improve database performance with connection pooling
- Authors
- Name
- Gene Zhang
What is connection pooling
Connection pooling uses a cache of database connections that can be reused when future requests to the database are required.
Advantages
- Save memory: with PostgreSQL, each new connection can take up to 1.3MB in memory.
- Avoid max connection limits: PostgreSQL allows 100 concurrent connections by default. Exceeding the stated number will result in an error stating "too many clients already".
- Faster response time: no need to build a new TCP connection.
- Better manage traffic peaks without causing outages.