Managing Index Scaling
1. Understanding Scaling Requirements
| Signal | Action |
| High latency | Add replicas / upgrade pod type |
| High fullness | Add shards / upgrade size |
| Rate-limit errors | Add replicas or reduce QPS |
2. Scaling Serverless Indexes
| Aspect | Behavior |
| Storage | Auto, unlimited |
| QPS | Auto-scales with traffic |
| RU/s caps | Plan-dependent; request lift |
3. Scaling Pod Replicas
Example: Scale Up
pc.configure_index("docs", replicas=5)
Note: Replicas can be scaled at runtime with no downtime.
4. Upgrading Pod Type
Warning: Pod type upgrades require creating a new index via collection. There's no in-place pod-type change.
| Path | Method |
| s1 → p1 | Create collection, recreate index |
| p1 → p2 | Create collection, recreate index |
5. Scaling Pod Size
Example: Vertical Scale
pc.configure_index("docs", pod_type="p1.x2") # x1 → x2
| Direction | Allowed |
| Upgrade size | Yes (x1→x2→x4→x8) |
| Downgrade size | No (recreate via collection) |
6. Understanding Scaling Limitations
| Limit | Detail |
| Shards | Set at creation; not mutable |
| Dim / metric | Immutable |
| Region / cloud | Immutable; must recreate |
7. Monitoring Scaling Operations
Example: Watch State
while pc.describe_index("docs").status["state"] != "Ready":
print(pc.describe_index("docs").status["state"])
time.sleep(5)
8. Implementing Zero-Downtime Scaling
Zero-Downtime Recipe
- Scale up replicas (online).
- For pod-type changes: create collection.
- Create new index from collection.
- Dual-write to old + new.
- Cut over reads.
- Drain writes; delete old index.
9. Handling Scaling Downtime
| Op | Downtime |
| Replica scale | None |
| Pod size upgrade | Brief transient elevated latency |
| Pod type change | Use dual-write to avoid |
10. Optimizing Costs During Scaling
| Tip | Effect |
| Scale down at off-peak | Save replica $ |
| Use collection for migration | Avoid re-embedding cost |
| Serverless for spiky traffic | Pay only for usage |