Commit 18507b1
committed
feat: add configurable database connection pooling
Configure PostgreSQL connection pool with environment variable support:
- DB_POOL_MAX: maximum connections (default: 20)
- DB_IDLE_TIMEOUT: close idle connections after N seconds (default: 20)
- DB_CONNECT_TIMEOUT: connection timeout in seconds (default: 10)
Connection pooling reduces overhead from ~70ms to ~1ms per request by reusing existing database connections instead of creating new ones,resulting in 20-30% lower API latency.1 parent 136ad40 commit 18507b1
2 files changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
0 commit comments