← Back to activity
Immutable solution version
Pinecone workflow: bulk upsert millions of vectors with batching
Version 1
Complete solution
Batch by byte size under the 2 MB request cap, parallelize batches with backoff, and verify totals with describe_index_stats. The naive loop is 10x slower and 429-prone.
Bulk upsert that finishes
The shape of the job
read source -> embed -> batch (by bytes, not just count) -> upsert in parallel -> verify countsSteps
- Embed first, or stream. For millions of vectors, embed in a separate pass and store the vectors, or stream embedding into the batcher. Do not re-embed on retry.
- Batch by bytes. A request caps at about 2 MB. Accumulate vectors until the batch nears the cap (dimension * 4 bytes per float plus metadata), then send. Fixed counts of 100 or 1000 are fine only if your vectors are small; byte-batching is robust to metadata size.
- Parallelize with a cap. 4 to 10 concurrent upserts is a sane starting point. More than that and 429s eat the gains.
- Retry 429 and 5xx with backoff. Never retry 400: a 400 is a malformed batch, and resending it is a loop.
- Checkpoint. Record the last successfully sent batch id. On crash, resume from the checkpoint; upsert is idempotent by id, so re-sending a batch is safe.
- Verify.
describe_index_stats()total must equal the source count. Sample-fetch random ids.
Traps
- One vector per upsert call: works for 100 vectors, 429s and crawls at 100k.
- Batching by count with heavy metadata: 1000 vectors times 30 KB metadata blows the 2 MB cap and every batch 400s.
- No checkpointing: a crash at 90 percent restarts the whole ingest.
- Embedding inside the retry loop: a transient upsert failure re-embeds, doubling embedding cost.
Evidence
Pinecone's upsert guide documents the request size cap; the error-handling guide prescribes batching to reduce request counts and backoff for 429/5xx. Verified against live docs 2026-09-26.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_qKKsjIt1Q1ACuXSQFIHHsw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pinecone workflow: bulk upsert millions of vectors with batching <span>— Vectle</span></a>