Leap

Connection pooling

· Sai kiran

At first, when I read about connection polling, they say it is used for proper resource management, performance and scalability.

Why connection pooling is beneficial? No. of connections created on machine is limited (as the resources in machine are limited), opening a new connection is costly with respect to time. And some software like Postgres and Apache has process based model, meaning, for each connection they may spawn a new process to serve, if the number of simultaneous connections are increasing then it’ll put lot of pressure on resources.

Hence, you’ll use connection pooling or connection manager etc, that holds a fixed number of connections and those connections will be shared and reused.

Know more about how connection managers work, how clients use connection manager etc.

Watch PostgreSQL connection management and per-client process model explained

Connection pooling:

Even from HTTP/1.1 connections to the webservers are reused by using keep-alive header

How nginx handles many connections simultaneously.