Swift Container Sharding Design Prompt
Plan and execute Swift container database sharding for large accounts — identify hot containers, size shard ranges, run swift-manage-shard-ranges safely, and verify replication without downtime.
- Target user
- Storage engineers operating large OpenStack Swift clusters
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior object-storage engineer who has sharded multi-billion-object Swift containers in production without taking the cluster offline. I will provide: - Cluster topology (proxy, account, container, object server counts; ring part power) - The offending container(s): object count, container DB size on disk, listing latency p99 - container-server and container-replicator configs - Current `swift-manage-shard-ranges` version and auto-sharding settings (`shard_container_threshold`, `shard_shrink_point`) - Symptoms: slow PUT/DELETE, replication lag, 503s on listings Your job: 1. **Confirm the diagnosis** — show me how to measure container DB row count, on-disk size, and replication time; explain why a single SQLite container DB over ~1M rows degrades and how sharding fixes it. 2. **Decide auto vs manual sharding** — when to enable the `container-sharder` daemon for hands-off operation vs driving it manually for a known hotspot. List the config keys that gate each path. 3. **Size the shard ranges** — given the object count and key distribution, recommend a target rows-per-shard and the resulting shard count. Explain `find_and_replace` vs `compact` and how to avoid creating thousands of tiny shards. 4. **Dry-run first** — give the exact `swift-manage-shard-ranges <db> find` and `find_and_replace` commands, how to inspect proposed ranges, and what "good" range boundaries look like (even key spread, no single giant range). 5. **Execute the rollout** — order of operations: enable sharder on container nodes, set state to `sharding`, watch cleaving progress, confirm shard containers populate in the `.shards_` account, then `sharded`. 6. **Verify integrity** — how to confirm object counts match pre/post, listings paginate correctly across shard boundaries, and misplaced objects get reconciled. 7. **Rollback / safety** — what to do if cleaving stalls, how to pause the sharder, and why you must never hand-edit shard range DBs. Output as: (a) a diagnosis checklist with the exact CLI to gather each metric, (b) a step-by-step sharding runbook with copy-paste commands, (c) a monitoring snippet (sharder logs + recon fields) to watch during rollout, (d) a go/no-go gate list before declaring the container `sharded`. Be explicit about which steps are irreversible and which can run during business hours.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Swift Object Expiration & Versioning Design Prompt
Design a Swift object lifecycle strategy combining object versioning and the object-expirer so tenants get recoverable overwrites and automatic deletion, without the expirer queue backing up or versioning silently doubling storage cost.
-
Swift Object Storage Ring Management Prompt
Manage Swift rings — add/remove nodes, rebalance, replication health, partition power, dispersion.
-
Nova Conductor & RPC Worker Scaling Tuning Prompt
Right-size nova-conductor, scheduler, and API workers plus oslo.messaging RPC pools so the control plane stops timing out under fleet growth — without over-provisioning RabbitMQ connections or starving the database pool.
-
Swift Proxy Memcache & Rate-Limit Tuning Prompt
Tune the Swift proxy-server pipeline (memcache, ratelimit, container/account caching) to stop 503 storms and cache stampedes under load.
More OpenStack prompts & error guides
Browse every OpenStack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.