Skip to content

Commit bf522c7

Browse files
authored
Merge pull request #3485 from meilisearch/update-ram-storage-recommendations
Update RAM and disk recommendations in storage docs
2 parents c871901 + ca21a5f commit bf522c7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

learn/engine/storage.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ LMDB stores its data in a [memory-mapped file](https://en.wikipedia.org/wiki/Mem
2424

2525
All documents stored on disk are automatically loaded in memory when Meilisearch asks for them. This ensures LMDB will always make the best use of the RAM available to retrieve the documents.
2626

27-
For the best performance, it is recommended to provide the same amount of RAM as the size the database takes on disk, so all the data structures can fit in memory.
27+
For best performance, Meilisearch works optimally when the full dataset fits in RAM. In practice, however, we consistently observe that a **RAM‑to‑disk ratio around 1/3 does not materially impact performance**, and for many workloads even ~1/10 works well. The effective memory requirement is highly use‑case‑dependent and varies with search and indexing pressure. RAM can be increased later to unlock more performance, but Meilisearch will not crash simply because the dataset size on disk exceeds the available RAM.
28+
29+
Disk latency is also important for performance: using a **low‑latency disk** (for example, an NVMe SSD) will give better results than a **high‑latency disk** (for example, HDD, NFS, or other network‑mounted storage).
2830

2931
### Understanding LMDB
3032

@@ -38,7 +40,7 @@ When deleting documents from a Meilisearch index, you may notice disk space usag
3840

3941
Since LMDB is memory mapped, it is the operating system that manages the real memory allocated (or not) to Meilisearch.
4042

41-
Thus, if you run Meilisearch as a standalone program on a server, LMDB will use the maximum RAM it can use. In general, you should have the same amount of RAM as the space taken on disk by Meilisearch for optimal performance.
43+
Thus, if you run Meilisearch as a standalone program on a server, LMDB will use the maximum RAM it can use. More RAM means more of the dataset stays in cache and fewer reads hit disk, but a [RAM‑to‑disk ratio of around 1/3 does not materially impact performance](#memory-mapping) for most workloads.
4244

4345
On the other hand, if you run Meilisearch along with other programs, the OS will manage memory based on everyone's needs. This makes Meilisearch's memory usage quite flexible when used in development.
4446

0 commit comments

Comments
 (0)