check-connection-pool

Analyze connection pool issues in PHP code: detect connection leaks, misconfigured pool sizing, unreleased connections, and timeout problems to assess connection pool health.

Last repository push
GitHub Stars
109
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "check-connection-pool" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-0aa93b738b5778ad30515edb8db9013049330d7453bc9bd45d0892ddd46017e4. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Analyze connection pool issues in PHP code: detect connection leaks, misconfigured pool sizing, unreleased connections, and timeout problems to assess connection pool health.

0 Downloads

Introduction source: third_party · dykyi-roman · 0.0.1 Reference

SkillPi interpretation

Tasks
Analyzes PHP code for connection pool issues. Detects connection leaks, improper pool sizing, missing connection release, timeout issues.
Audience
Reviewing database-heavy PHP applications Investigating connection exhaustion or memory leaks Auditing long-running workers (queue consumers, daemons) Checking Doctrine EntityManager lifecycle issues Reviewing HTTP client usage patterns
Inputs and outputs
```markdown
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: check-connection-pool
description: Analyzes PHP code for connection pool issues. Detects connection leaks, improper pool sizing, missing connection release, timeout issues.

Connection Pool Performance Analysis

Analyze PHP code for connection pool issues and database connection management problems.

When to Use

  • Reviewing database-heavy PHP applications
  • Investigating connection exhaustion or memory leaks
  • Auditing long-running workers (queue consumers, daemons)
  • Checking Doctrine EntityManager lifecycle issues
  • Reviewing HTTP client usage patterns

Analysis Approach

  1. Scan for connection creation patterns (PDO, Redis, Guzzle)
  2. Check loop bodies for repeated connection instantiation
  3. Verify try/finally cleanup on pool acquire/release
  4. Check timeout configuration on all connection types
  5. Review persistent connection usage and state reset
  6. Audit worker processes for connection refresh logic

Detection Rules

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

Grep Patterns

# 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"

Severity Classification

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

Output Format

### 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

  • references/patterns.md — detailed detection patterns with code examples, secure pool implementations, health check and worker refresh patterns

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 针对 PHP 数据库连接池性能问题,提供系统化的检测规则和 grep 模式
  • 覆盖连接泄漏、池大小配置、超时设置等关键运维痛点
Trigger Precision85/100

Highlights

  • description 清晰明确,触发词精准,边界清晰
Structure and Standards75/100

Areas to improve

  • Document is too long Reported severity: Minor

    Skill 文档内容超过 500 行,影响可读性

    Recommendation: 考虑将详细检测模式、代码示例等移至引用文件中,主文档保持简洁

Highlights

  • 结构完整,包含使用场景、分析步骤、检测规则、严重性分类和输出格式
  • 提供了具体的 grep 命令用于实际检测
Execution Reliability70/100

Areas to improve

  • 未覆盖所有 PHP 数据库扩展 Reported severity: Minor

    检测规则主要针对 PDO、Redis、Guzzle,未覆盖 mysqli 等其他常见 PHP 数据库连接方式

    Recommendation: 补充 mysqli 相关的连接池检测规则和 grep 模式

Highlights

  • 提供了具体的 grep 模式,工具来源明确,参数合理
  • 输出格式清晰,包含严重性、位置、影响、修复建议等完整信息
Evidence Verifiability (mean of the first four)76/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.