P5/scale: queue-depth-aware placement + DB connection pooling - #45
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The two fleet-scale levers from DESIGN §10.7, plus the queue-depth placement signal.
What
select_placementuses the node-reported livequeue_depthas the load metric (falls back torunning_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).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 throughcreate_app.Tests
pytest tests/control -q→ 41 passed (+3: placement prefers lower queue depth; SQLite vs Postgres engine kwargs); ruff + mypy clean.🤖 Generated with Claude Code