Size and test a dedicated read nodes index
Calculate how many shards and replicas a Pinecone dedicated read nodes index needs, and load-test your workload to validate the configuration.
Calculate the size of your index
Section titled “Calculate the size of your index”To determine how many shards your index requires, calculate your index size and then apply the number of shards formula.
Index size
Section titled “Index size”A record can include a dense vector, a sparse vector, or both. Use the formula that matches your data to calculate total size:
An index of dense vectors contains records with one dense vector each.
Calculate size (assuming no sparse vectors)
Index size = Number of records × (
ID size +
Metadata size +
Dense vector dimensions × 4 bytes
)Where:
ID sizeandMetadata sizeare measured in bytes, averaged across all records.- Each
Dense vector dimensionuses 4 bytes.
Example calculations
These examples assume 8-byte IDs:
| Records | Dense vector dimensions | Avg metadata size | Index size |
|---|---|---|---|
| 500,000 | 768 | 500 bytes | 1.79 GB |
| 1,000,000 | 1536 | 1,000 bytes | 7.15 GB |
| 5,000,000 | 1024 | 15,000 bytes | 95.5 GB |
| 10,000,000 | 1536 | 1,000 bytes | 71.5 GB |
An index of sparse vectors contains records with one sparse vector each.
Calculate size
Index size = Number of records × (
ID size +
Metadata size +
Number of non-zero sparse values × 8 bytes
)Where:
ID sizeandMetadata sizeare measured in bytes, averaged across all records.Number of non-zero sparse values: Average number across all records. To find the count for a single record, check the length of the sparse vector'sindicesorvaluesarray. Each non-zero value uses 8 bytes.
Example calculations
These examples assume 8-byte IDs:
| Records | Avg number of non-zero sparse values | Avg metadata size | Index size |
|---|---|---|---|
| 500,000 | 10 | 500 bytes | 0.29 GB |
| 1,000,000 | 50 | 1,000 bytes | 1.41 GB |
| 5,000,000 | 100 | 15,000 bytes | 79.0 GB |
| 10,000,000 | 50 | 1,000 bytes | 14.1 GB |
An index with both dense and sparse vectors contains records that each have one dense vector and an optional sparse vector.
Calculate size
Index size = Number of records × (
ID size +
Metadata size +
Dense vector dimensions × 4 bytes +
Number of non-zero sparse values × 8 bytes
)Where:
ID sizeandMetadata sizeare measured in bytes, averaged across all records.- Each
Dense vector dimensionuses 4 bytes. Number of non-zero sparse values: Average number across all records, including those without sparse vectors. To find the count for a single record, check the length of the sparse vector'sindicesorvaluesarray. Each non-zero value uses 8 bytes.
Example calculations
These examples assume 8-byte IDs:
| Records | Dense vector dimensions | Avg number of non-zero sparse values | Avg metadata size | Index size |
|---|---|---|---|---|
| 500,000 | 768 | 10 | 500 bytes | 1.83 GB |
| 1,000,000 | 1536 | 50 | 1,000 bytes | 7.54 GB |
| 5,000,000 | 1024 | 100 | 15,000 bytes | 99.5 GB |
| 10,000,000 | 1536 | 50 | 1,000 bytes | 75.4 GB |
Number of shards
Section titled “Number of shards”To calculate the number of shards your index requires, divide the size of your index by 250 GB and round up:
Minimum shards = (Index size) / (250 GB per shard)To maintain optimal performance, provision additional shards to keep your index at 70-80% capacity. For example, a 500 GB index should have three shards (750 GB capacity = 67% full), not two shards (500 GB capacity = 100% full).
Example shard calculations
Section titled “Example shard calculations”| Index size | Minimum shards | Recommended shards |
|---|---|---|
| ~71 GB | 1 (250 GB; 28% full) | 1 (250 GB; 28% full) |
| ~300 GB | 2 (500 GB; 60% full) | 2 (500 GB; 60% full) |
| ~400 GB | 2 (500 GB; 80% full) | 3 (750 GB; 53% full) |
Other considerations
Section titled “Other considerations”- Every index must have at least one shard. However, you can pause an index by reducing its replicas to 0.
- After you've created your index, monitor its fullness.
Number of replicas
Section titled “Number of replicas”To calculate the number of replicas your index requires, first test your workload to find the QPS a single replica can handle at your target latency. Then, use this formula, and round up:
Minimum replicas = (Required QPS) / (QPS per replica)For example, if one replica handles 50 QPS at your target latency and you need 150 QPS, you need three replicas.
For how throughput scales with replicas and how to size for high availability, see Replicas.
Test your workload
Section titled “Test your workload”To choose between on-demand and dedicated read nodes, or to optimize your dedicated read nodes configuration, test with your actual workload. Performance varies based on factors such as the size of your index, vector dimensionality, metadata characteristics, and query patterns.
Calculate the size of your index
Determine how many shards your index requires. See Calculate the size of your index.
Create and populate a test index
Populate a dedicated read nodes index with data representative of your workload.
Migrate your test index to dedicated read nodes (if necessary)
If your test index is on-demand, migrate it with a single
b1replica to start.Run a load test
Send realistic query patterns against your test index, gradually increasing QPS. For example, start at 10 QPS for about 30 minutes, then step up in 10-QPS increments while monitoring latency. Note the QPS where latency crosses your target threshold.
Calculate replicas
From the QPS a single replica sustained, determine how many replicas you need for your target throughput.
Adjust and re-test
If you haven't hit your performance and cost goals, change the configuration and test again:
- Add or remove shards for storage capacity
- Add or remove replicas for throughput
- Change node types for different performance characteristics
Continue iterating until you meet your requirements with room for growth.