Skip to content

Commit

Permalink
Document the searcher split cache
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed Feb 5, 2025
1 parent 6c3159e commit 22bb1d7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/configuration/node-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ This section contains the configuration options for a Searcher.

### Searcher split cache configuration

This section contains the configuration options for the on disk searcher split cache.
This section contains the configuration options for the on-disk searcher split cache. Files are stored in the data directory under `searcher-split-cache/`.

| Property | Description | Default value |
| --- | --- | --- |
Expand Down
4 changes: 4 additions & 0 deletions docs/operating/data-directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ This directory is used for caching splits that will undergo a merge operation to

You can [configure](../configuration/node-config#indexer-configuration) the number of splits the cache can hold with `split_store_max_num_splits` and limit the overall size in bytes of splits with `split_store_max_num_bytes`.

### `/searcher-split-cache` directory

This directory is used by searcher nodes to cache entire splits and reduce calls to the object store. It won't be created unless you set the `split_cache` fields in the [searcher configuration](../configuration/node-config.md#searcher-configuration).


## Setting the right splits cache limits

Expand Down
8 changes: 8 additions & 0 deletions docs/overview/concepts/querying.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,18 @@ Search stream queries can take a huge amount of RAM. Quickwit limits the number

Quickwit does caching in many places to deliver a highly performing query engine.

In memory:

- Hotcache caching: A static cache that holds information about a split file internal representation. It helps speed up the opening of a split file. Its size can be defined via the `split_footer_cache_capacity` configuration parameter.
- Fast field caching: Fast fields tend to be accessed very frequently by users especially for stream requests. They are cached in a RAM whose size can be limited by the `fast_field_cache_capacity` configuration value.
- Partial request caching: In some cases, like when using dashboards, some very similar requests might be issued, with only timestamp bounds changing. Some partial results can be cached to make these requests faster and issue less requests to the storage. They are cached in a RAM whose size can be limited by the `partial_request_cache_capacity` configuration value.

On disk:

- The split cache stores entire splits on disk. It can be enabled by setting the `split_cache` configuration fields. This cache can help reduce object store costs and load. Searchers populate this cache with complete splits and evict them with a simple LRU strategy.

Learn more about cache parameters in the [searcher configuration docs](../../configuration/node-config.md#searcher-configuration).

### Scoring

Quickwit supports sorting docs by their BM25 scores. In order to query by score, [fieldnorms](../../configuration/index-config.md#text-type) must be enabled for the field. By default, BM25 scoring is disabled to improve query latencies but it can be opt-in by setting the `sort_by` option to `_score` in queries.
Expand Down
5 changes: 2 additions & 3 deletions quickwit/quickwit-serve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,11 @@ pub async fn serve_quickwit(
}
}
}
let split_cache_root_directory: PathBuf =
node_config.data_dir_path.join("searcher-split-cache");

let split_cache_opt: Option<Arc<SplitCache>> =
if let Some(split_cache_limits) = node_config.searcher_config.split_cache {
let split_cache = SplitCache::with_root_path(
split_cache_root_directory,
node_config.data_dir_path.join("searcher-split-cache"),
storage_resolver.clone(),
split_cache_limits,
)
Expand Down

0 comments on commit 22bb1d7

Please sign in to comment.