From acc
Analyzes PHP code for connection pool issues like leaks, improper sizing, missing releases, timeouts in PDO, Redis, Guzzle, Doctrine. For database-heavy apps, workers, daemons.
How this skill is triggered — by the user, by Claude, or both
Slash command
/acc:check-connection-poolThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze PHP code for connection pool issues and database connection management problems.
Analyze PHP code for connection pool issues and database connection management problems.
| ID | Pattern | What to Look For |
|---|---|---|
| CP-01 | Connection leak | new PDO without cleanup in exception/early-return paths |
| CP-02 | Connection in loop | new PDO/new Redis/new Client inside foreach/while |
| CP-03 | Missing timeout | PDO without ATTR_TIMEOUT, Redis without connect timeout |
| CP-04 | Persistent misuse | ATTR_PERSISTENT => true without shutdown cleanup |
| CP-05 | Pool exhaustion | Multiple connections opened without reuse |
| CP-06 | Missing finally | $pool->release() not in finally block |
| CP-07 | State not reset | Connection returned to pool with modified session state |
| CP-08 | Doctrine issues | EntityManager not cleared, long-held transactions |
| CP-09 | Worker stale conn | Long-running worker without connection refresh |
| CP-10 | HTTP no pooling | file_get_contents in loop, no keep-alive headers |
# New connection in loops
Grep: "foreach.*\{[^}]*new PDO|while.*\{[^}]*new PDO" --glob "**/*.php" --multiline
# Missing connection close
Grep: "new Redis\(\)" --glob "**/*.php"
# Persistent connections
Grep: "ATTR_PERSISTENT" --glob "**/*.php"
# Connection without timeout
Grep: "new PDO\s*\([^)]+\)\s*;" --glob "**/*.php"
# Static connection storage
Grep: "static.*PDO|static.*connection" --glob "**/*.php"
| Pattern | Severity |
|---|---|
| Connection in loop | Critical |
| Connection leak (no finally) | Critical |
| No connection timeout | Major |
| Pool exhaustion risk | Major |
| Missing connection health check | Major |
| Persistent connection misuse | Minor |
| Static connection storage | Minor |
### Connection Pool: [Description]
**Severity:** Critical/Major/Minor
**Location:** `file.php:line`
**Impact:** [Database overload, connection exhaustion, memory leak]
**Issue:**
[Description of the connection management problem]
**Code:**
[Problematic code snippet]
**Fix:**
[Proper connection management code]
**Expected Improvement:**
- Connection count: 100 -> 10 (pooled)
- Memory usage: -50% (connections reused)
- DB load: -80% (connection overhead eliminated)
references/patterns.md — detailed detection patterns with code examples, secure pool implementations, health check and worker refresh patternsnpx claudepluginhub dykyi-roman/awesome-claude-code --plugin accAnalyzes PHP code for database scaling issues like single connections for all queries, missing read replicas, SELECTs hitting primary DB, and absent connection pooling.
Guides configuration of database connection pools including sizing formulas, PgBouncer transaction-mode pooling, and diagnostics. Useful when connections are exhausted or latency spikes from new connections.
Audits connections, calculates pool sizes, configures app-level pooling params, and deploys PgBouncer/ProxySQL for PostgreSQL/MySQL to prevent exhaustion and boost throughput.