Skip to content

P5/scale: queue-depth-aware placement + DB connection pooling - #45

Merged
Lothnic merged 1 commit into
mainfrom
control-pooling-queue
Aug 4, 2026
Merged

P5/scale: queue-depth-aware placement + DB connection pooling#45
Lothnic merged 1 commit into
mainfrom
control-pooling-queue

Conversation

@Lothnic

@Lothnic Lothnic commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

The two fleet-scale levers from DESIGN §10.7, plus the queue-depth placement signal.

What

  • Queue-depth-aware placementselect_placement uses the node-reported live queue_depth as the load metric (falls back to running_engines). A busy node with fewer engines but a deeper queue loses to a quieter one. Pairs with meridian-node PR docs: v0.7.0 release notes alignment #14 (the node reports it).
  • Connection pooling — non-SQLite engines get a sized, pre-pinged, recycling pool (MERIDIAN_CONTROL_DB_POOL_SIZE / MERIDIAN_CONTROL_DB_MAX_OVERFLOW, defaults 5/10); SQLite keeps its thread-safe connect args and no pool sizing. Threaded through create_app.

Tests

pytest tests/control -q41 passed (+3: placement prefers lower queue depth; SQLite vs Postgres engine kwargs); ruff + mypy clean.

🤖 Generated with Claude Code

Placement: select_placement now uses the node-reported live queue_depth as the
load metric (falling back to running_engines), so a busy-but-fewer-engines node
loses to a quieter one. Pooling: non-SQLite engines get a sized, pre-pinged,
recycling connection pool (MERIDIAN_CONTROL_DB_POOL_SIZE / _MAX_OVERFLOW); SQLite
keeps its thread-safe args. These are the fleet-scale levers from DESIGN 10.7.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 4, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Lothnic
Lothnic merged commit 325739d into main Aug 4, 2026
6 checks passed
@Lothnic
Lothnic deleted the control-pooling-queue branch August 4, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants