Skip to content

Commit 4a20895

Browse files
Merge #1864
1864: V0.29: updates to auto-batching r=guimachiavelli a=maryamsulemani97 closes #1838 Co-authored-by: Maryam Sulemani <[email protected]> Co-authored-by: Maryam <[email protected]>
2 parents b7817d3 + 865e016 commit 4a20895

File tree

8 files changed

+37
-89
lines changed

8 files changed

+37
-89
lines changed

.vuepress/config.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -271,21 +271,6 @@ module.exports = {
271271
},
272272
],
273273
},
274-
{
275-
title: '🧪 Experimental',
276-
collapsable: false,
277-
path: '/learn/experimental/overview.html',
278-
children: [
279-
{
280-
title: 'Overview',
281-
path: '/learn/experimental/overview',
282-
},
283-
{
284-
title: 'Auto-batching',
285-
path: '/learn/experimental/auto-batching',
286-
},
287-
],
288-
},
289274
{
290275
title: '👐 Contributing',
291276
path: '/learn/contributing/overview.html',

.vuepress/public/_redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,6 @@
196196

197197
# Rename indexation to indexing
198198
/learn/advanced/indexation.html /learn/advanced/indexing.html
199+
200+
# Remove autobatching
201+
/learn/experimental/auto-batching.html /learn/core_concepts/documents.html

learn/advanced/indexing.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ Multi-threading is unfortunately not possible in machines with only one processo
2828

2929
## Improving indexing performance
3030

31-
If you encounter performance issues during the indexing we recommend trying the following points:
31+
If you encounter performance issues during indexing, we recommend trying the following:
3232

3333
- Make sure you are using the latest [stable version of Meilisearch](https://github.com/meilisearch/meilisearch/releases). New releases often include performance improvements that can significantly increase indexing speed.
3434

35-
- indexing is a memory-intensive and multi-threaded operation. This means **the more memory and processor cores available, the faster Meilisearch will index new documents**. When trying to improve indexing speed, using a machine with more processor cores is more effective than increasing RAM.
35+
- Indexing is a memory-intensive and multi-threaded operation. This means **the more memory and processor cores available, the faster Meilisearch will index new documents**. When trying to improve indexing speed, using a machine with more processor cores is more effective than increasing RAM.
3636

3737
- **Bigger HTTP payloads are processed more quickly than smaller payloads**. For example, adding the same 100,000 documents in two batches of 50,000 documents will be quicker than adding them in four batches of 25,000 documents. By default, Meilisearch sets the maximum payload size to 100MB, but [you can change this value if necessary](/learn/configuration/instance_options.md#payload-limit-size). That said, **the bigger the payload is, the higher the memory consumption will be**. An instance may crash if it requires more RAM than is currently available in a machine.
3838

39-
- If you want to speed up indexing but don't wish to batch documents manually, consider giving our [experimental auto-batcher](/learn/experimental/auto-batching.md) a try.
40-
4139
- **Meilisearch should not be your main database**. The more documents you add, the longer will indexing and search take, so you should only index documents you want to retrieve when searching.
4240

4341
- By default, all document fields are searchable. We strongly recommend changing this by [updating the `searchableAttributes` list](/reference/api/settings.md#update-searchable-attributes) so it only contains fields you want to search in. The fewer fields Meilisearch needs to index, the faster is the indexing process.

learn/configuration/instance_options.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ If no master key is provided in a `development` environment, all routes will be
106106

107107
[Learn more about Meilisearch's use of security keys.](/learn/security/master_api_keys.md)
108108

109+
### Disable auto-batching
110+
111+
::: warning
112+
🚩 This is a CLI flag and does not take any values. Assigning a value will throw an error. 🚩
113+
:::
114+
115+
**Environment variable**: `MEILI_DISABLE_AUTO_BATCHING`
116+
**CLI option**: `--disable-auto-batching`
117+
118+
Deactivates auto-batching when provided.
119+
120+
[Learn more about auto-batching.](/learn/core_concepts/documents.md#auto-batching)
121+
109122
### Disable analytics
110123

111124
::: warning

learn/core_concepts/documents.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,19 @@ Since CSV does not support arrays or nested objects, `cast` cannot be converted
124124
::: note
125125
If you don't specify the data type for an attribute, it will default to `:string`.
126126
:::
127+
128+
### Auto-batching
129+
130+
Auto-batching combines consecutive document addition requests into a single batch and processes them together. This significantly speeds up the indexing process.
131+
132+
Meilisearch batches document addition requests when they:
133+
134+
- Target the same index
135+
- Have the same update method (i.e., [POST](/reference/api/documents.md#add-or-replace-documents) or [PUT](/reference/api/documents.md#add-or-update-documents))
136+
- Are immediately consecutive
137+
138+
Tasks within the same batch share the same values for `startedAt`, `finishedAt`, and `duration`.
139+
140+
If a task fails due to an invalid document, it will be removed from the batch. The rest of the batch will still process normally. If an [`internal`](/reference/api/overview.md#errors) error occurs, the whole batch will fail and all tasks within it will share the same `error` object.
141+
142+
You can deactivate auto-batching using the `--disable-auto-batching` command-line flag or the `MEILI_DISABLE_AUTO_BATCHING` environment variable. This is useful in cases where you want to avoid any potential bugs in the feature or reduce visibility latency. When auto-batching is disabled, the whole queue takes longer to process, but each individual task will be processed earlier (until a certain number of processed tasks).

learn/experimental/auto-batching.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

learn/experimental/overview.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

learn/getting_started/quick_start.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ Meilisearch stores data in the form of discrete records, called [documents](/lea
181181
Meilisearch currently only accepts data in JSON, NDJSON, and CSV formats. You can read more about this in our [documents guide](/learn/core_concepts/documents.md#dataset-format).
182182
:::
183183

184-
The previous command added documents from `movies.json` to a new index called `movies`. After adding documents, you should receive a response like this:
184+
The previous command added documents from `movies.json` to a new index called `movies`.
185+
186+
By default, Meilisearch combines consecutive document requests into a single batch and processes them together. This process is called auto-batching, and it significantly speeds up indexing. After adding documents, you should receive a response like this:
185187

186188
```json
187189
{

0 commit comments

Comments
 (0)