Limit the number of search requests running concurrently #4489
Labels
CPU/RAM usage
impacts docs
This issue involves changes in the Meilisearch's documentation
v1.8.0
PRs/issues solved in v1.8.0 released on 2024-05-06
Milestone
Related product team resources: PRD (internal only)
Related product discussion: https://github.com/orgs/meilisearch/discussions/729
Related spec: WIP
Motivation
The search requests in meilisearch are intensive, which means it’s useless to run multiple searches at the same time.
The most efficient way to treat search requests is to run one search request per core.
But we don't want to refuse search requests straight away when all cores are being used; thus, we're going to keep track of the search requests to process in a queue of fixed-size and then randomly pick the next search request to be processed.
If the queue is full, then Meilisearch will return an error (TBD) with the error code 503 service unavailable and a
retry-after
header.Since the size of the queue may vary between use cases, we'll also need to introduce a new global setting for the whole instance, specifying the size of the queue.
See full usage here: https://meilisearch.notion.site/API-usage-of-the-search-limiter-c1edc092f3c746d6899c5ba7bfa9a6a8?pvs=74
Usage
TODO
main
Reminders when modifying the Setting API
test_setting_routes
macro/settings/my-new-setting
configurated in themake_setting_routes
macro/settings
route configurated in theupdate_all
function/settings
route serializing, e.g., enums case can be different (camelCase
in route andPascalCase
in the dump)Special cases when adding a setting for an experimental feature
Unset
when returned from the index in this situation. See an example)validate_settings
function)Impacted teams
@meilisearch/docs-team
The text was updated successfully, but these errors were encountered: