Managing Index Scaling

1. Understanding Scaling Requirements

SignalAction
High latencyAdd replicas / upgrade pod type
High fullnessAdd shards / upgrade size
Rate-limit errorsAdd replicas or reduce QPS

2. Scaling Serverless Indexes

AspectBehavior
StorageAuto, unlimited
QPSAuto-scales with traffic
RU/s capsPlan-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.
PathMethod
s1 → p1Create collection, recreate index
p1 → p2Create collection, recreate index

5. Scaling Pod Size

Example: Vertical Scale

pc.configure_index("docs", pod_type="p1.x2")  # x1 → x2
DirectionAllowed
Upgrade sizeYes (x1→x2→x4→x8)
Downgrade sizeNo (recreate via collection)

6. Understanding Scaling Limitations

LimitDetail
ShardsSet at creation; not mutable
Dim / metricImmutable
Region / cloudImmutable; 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

  1. Scale up replicas (online).
  2. For pod-type changes: create collection.
  3. Create new index from collection.
  4. Dual-write to old + new.
  5. Cut over reads.
  6. Drain writes; delete old index.

9. Handling Scaling Downtime

OpDowntime
Replica scaleNone
Pod size upgradeBrief transient elevated latency
Pod type changeUse dual-write to avoid

10. Optimizing Costs During Scaling

TipEffect
Scale down at off-peakSave replica $
Use collection for migrationAvoid re-embedding cost
Serverless for spiky trafficPay only for usage