Comment by k4rli

6 days ago

Librechat has it as a dependency. Seems very memory heavy like elasticsearch. 3G+ memory at all times even on a new-ish instance with just one user.

Actually, Meilisearch uses the RAM available by design because it uses LMDB (which is memory-mapped) under the hood for key-value storage.

It's a feature, not a bug :D

The cool thing about that is that it is the OS that will get to choose which process to allocate memory, and you can always run it somewhere with less memory available, and it will work the same way

  • But is there any way to limit the memory? Sometimes I want to run more than one thing on the box. I found that meilisearch doesn't have a "max total memory use" flag

    • Hey, as the previous person said you cannot really limit the memory, Meilisearch uses.

      But your OS will share the Meilisearch memory with other process seamlessly, you don’t have anything to do. In htop it’s the yellow bar, and it’s basically a big cache shared between all processes.

      2 replies →

Fire it up in a docker container and limit the RAM usage that way.

This is a trick I learned years ago with other mmap-based systems.

  • Are you sure it really limits the RAM? You’re still using the same kernel, and if a process is using more memory than another one I would expect the kernel to keep more of its memory page in RAM than the other.

    What was your strategy to measure that?