---
title: "Discussion on \"What Is a Connection Pool? Why Your App Reuses Database Connections Instead of Opening New Ones\" | Hashnode"
description: "Discussion on \"What Is a Connection Pool? Why Your App Reuses Database Connections Instead of Opening New Ones\". To put it simply, a connection pool is a small set of database connections your app opens once and lends out again and again, instead of paying to open a new one for every request.\nSo why does my app"
url: "https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What Is a Connection Pool? Why Your App Reuses Database Connections Instead of Opening New Ones](https://itsmeminsithu.hashnode.dev/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones?utm_source=hashnode&utm_medium=feed)

To put it simply, a connection pool is a small set of database connections your app opens once and lends out again and again, instead of paying to open a new one for every request. So why does my app

3h ago · 8 min read · itsmeminsithu.hashnode.dev  
Read the article

-   [#databases](https://hashnode.com/tag/databases)
-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#system-design](https://hashnode.com/tag/system-design)
-   [#backend](https://hashnode.com/tag/backend)
-   [#sql](https://hashnode.com/tag/sql)

## Written by

[Min SiThu](https://hashnode.com/@itsmeminsithu)

@itsmeminsithu · Singapore

  
[View profile](https://hashnode.com/@itsmeminsithu)

Software Engineer

Nubbad Developer. | Now I accidentally create problems.

## Responses 1

Markdown supported · ⌘↵ to post

[SqlOtter](https://hashnode.com/@sqlotter)

[1h ago](https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8/comment/6b0f8e3e0494c63f5b1992d6)

For the “slow database or empty pool?” case, time three things separately on the app side: checkout wait, query execution, and how long the connection stays checked out. During a spike, use a separate diagnostic connection and inspect pg\_stat\_activity for the app’s application\_name. Look at state, wait\_event\_type, and xact\_start. A long “idle in transaction” session points to an open transaction between statements. It doesn’t prove a leak by itself, so correlate it with checkout duration and the code path that owns that connection.
