mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-03 01:48:32 +02:00
Update default value of indexing_threshold (#2236)
This commit is contained in:
@@ -40,8 +40,7 @@ There are two ways to configure the usage of memmap(also known as on-disk) stora
|
||||
|
||||
- Set up `on_disk` option for the vectors in the collection create API:
|
||||
|
||||
*Available as of v1.2.0*
|
||||
|
||||
*Available as of v1.2.0*
|
||||
|
||||
{{< code-snippet path="/documentation/headless/snippets/create-collection/with-vectors-on-disk/" >}}
|
||||
|
||||
@@ -51,17 +50,17 @@ This is the recommended way, in case your Qdrant instance operates with fast dis
|
||||
|
||||
- Set up `memmap_threshold` option. This option will set the threshold after which the segment will be converted to memmap storage.
|
||||
|
||||
There are two ways to do this:
|
||||
There are two ways to do this:
|
||||
|
||||
1. You can set the threshold globally in the [configuration file](/documentation/guides/configuration/). The parameter is called `memmap_threshold` (previously `memmap_threshold_kb`).
|
||||
2. You can set the threshold for each collection separately during [creation](/documentation/concepts/collections/#create-collection) or [update](/documentation/concepts/collections/#update-collection-parameters).
|
||||
1. You can set the threshold globally in the [configuration file](/documentation/guides/configuration/). The parameter is called `memmap_threshold` (previously `memmap_threshold_kb`).
|
||||
2. You can set the threshold for each collection separately during [creation](/documentation/concepts/collections/#create-collection) or [update](/documentation/concepts/collections/#update-collection-parameters).
|
||||
|
||||
{{< code-snippet path="/documentation/headless/snippets/create-collection/with-optimizer-config/" >}}
|
||||
|
||||
The rule of thumb to set the memmap threshold parameter is simple:
|
||||
|
||||
- if you have a balanced use scenario - set memmap threshold the same as `indexing_threshold` (default is 20000). In this case the optimizer will not make any extra runs and will optimize all thresholds at once.
|
||||
- if you have a high write load and low RAM - set memmap threshold lower than `indexing_threshold` to e.g. 10000. In this case the optimizer will convert the segments to memmap storage first and will only apply indexing after that.
|
||||
- if you have a balanced use scenario - set memmap threshold the same as `indexing_threshold` (default is 10000). In this case the optimizer will not make any extra runs and will optimize all thresholds at once.
|
||||
- if you have a high write load and low RAM - set memmap threshold lower than `indexing_threshold` to e.g. 5000. In this case the optimizer will convert the segments to memmap storage first and will only apply indexing after that.
|
||||
|
||||
In addition, you can use memmap storage not only for vectors, but also for HNSW index.
|
||||
To enable this, you need to set the `hnsw_config.on_disk` parameter to `true` during collection [creation](/documentation/concepts/collections/#create-a-collection) or [updating](/documentation/concepts/collections/#update-collection-parameters).
|
||||
|
||||
@@ -110,11 +110,12 @@ storage:
|
||||
# Note: 1Kb = 1 vector of size 256
|
||||
memmap_threshold: 200000
|
||||
|
||||
# Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing
|
||||
# Default value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>.
|
||||
# To disable vector indexing, set to `0`.
|
||||
# Note: 1kB = 1 vector of size 256.
|
||||
indexing_threshold_kb: 20000
|
||||
# Maximum size (in KiloBytes) of vectors allowed for plain index.
|
||||
# Default value based on experiments and observations.
|
||||
# Note: 1Kb = 1 vector of size 256
|
||||
# To explicitly disable vector indexing, set to `0`.
|
||||
# If not set, the default value will be used.
|
||||
indexing_threshold_kb: 10000
|
||||
```
|
||||
|
||||
In addition to the configuration file, you can also set optimizer parameters separately for each [collection](/documentation/concepts/collections/).
|
||||
|
||||
@@ -30,7 +30,7 @@ To control this behavior and optimize for your system’s limits, adjust the fol
|
||||
|-------------------------------------------|-------------------------------------------------|----------------------------------------------------|
|
||||
| Fastest upload, tolerate high RAM usage | Disable indexing completely | `indexing_threshold: 0` |
|
||||
| Low memory usage during upload | Defer HNSW graph construction (recommended) | `m: 0` |
|
||||
| Faster index availability after upload | Keep indexing enabled (default behavior) | `m: 16`, `indexing_threshold: 20000` *(default)* |
|
||||
| Faster index availability after upload | Keep indexing enabled (default behavior) | `m: 16`, `indexing_threshold: 10000` *(default)* |
|
||||
|
||||
Indexing must be re-enabled after upload to activate fast HNSW search if it was disabled during ingestion.
|
||||
|
||||
@@ -408,13 +408,13 @@ client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
With indexing_threshold set to 0, storage won't be optimized properly, which can lead to high RAM usage as segments accumulate in memory.
|
||||
</aside>
|
||||
|
||||
After upload is done, you can enable indexing by setting `indexing_threshold` to a desired value (default is 20000):
|
||||
After upload is done, you can enable indexing by setting `indexing_threshold` to a desired value (default is 10000):
|
||||
|
||||
```http
|
||||
PATCH /collections/{collection_name}
|
||||
{
|
||||
"optimizers_config": {
|
||||
"indexing_threshold": 20000
|
||||
"indexing_threshold": 10000
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -437,7 +437,7 @@ const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.updateCollection("{collection_name}", {
|
||||
optimizers_config: {
|
||||
indexing_threshold: 20000,
|
||||
indexing_threshold: 10000,
|
||||
},
|
||||
});
|
||||
```
|
||||
@@ -453,7 +453,7 @@ let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
client
|
||||
.update_collection(
|
||||
UpdateCollectionBuilder::new("{collection_name}")
|
||||
.optimizers_config(OptimizersConfigDiffBuilder::default().indexing_threshold(20000)),
|
||||
.optimizers_config(OptimizersConfigDiffBuilder::default().indexing_threshold(10000)),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user