[Self-Hosted] Meilisearch default memory limits cause OOM crashes

(#870) Bug Fixed search self-hosting

Observed behaviour

When setting up an instance and using the default meilisearch values, the meilisearch container eventually gets killed by oom-killer. This repeats after every meilisearch is brought back up, in my case around every 13-15 minutes.

Reproduction steps

  1. Set up fluxer with default values
  2. Wait for meilisearch to get killed

Build information

Canary Web 2026.926.115056, macOS 10.15 (arm64), Firefox 153.0, Locale en-US

Platform

Self-hosting

Evidence

[ 1017.746688] indexing-thread invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=0
[ 1017.746694] CPU: 10 UID: 0 PID: 25267 Comm: indexing-thread Tainted: P           OE      6.12.107+deb13-amd64 [#1](https://github.com/fluxerapp/fluxer/issues/1)  Debian 6.12.107-1
[ 1017.746697] Tainted: [P]=PROPRIETARY_MODULE, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[ 1017.746698] Hardware name: ASUS System Product Name/Pro WS W790-ACE, BIOS 1904 12/03/2025
[ 1017.746699] Call Trace:
[ 1017.746701]  <TASK>
[ 1017.746704]  dump_stack_lvl+0x5d/0x80
[ 1017.746710]  dump_header+0x43/0x1aa
[ 1017.746713]  oom_kill_process.cold+0x8/0x8d
[ 1017.746716]  out_of_memory+0x219/0x4b0
[ 1017.746720]  mem_cgroup_out_of_memory+0x12b/0x140
[ 1017.746723]  try_charge_memcg+0x488/0x630
[ 1017.746726]  __mem_cgroup_charge+0x42/0xd0
[ 1017.746729]  do_anonymous_page+0x35d/0x870
[ 1017.746731]  ? __pte_offset_map+0x1b/0x180
[ 1017.746734]  __handle_mm_fault+0xb14/0xf70
[ 1017.746737]  ? psi_group_change+0x123/0x2f0
[ 1017.746739]  handle_mm_fault+0xe2/0x2c0
[ 1017.746741]  do_user_addr_fault+0x217/0x620
[ 1017.746743]  exc_page_fault+0x7e/0x180
[ 1017.746746]  asm_exc_page_fault+0x26/0x30
[ 1017.746749] RIP: 0033:0x7fb39fddbcdd
[ 1017.746773] Code: 48 89 44 17 c9 48 89 44 17 d1 48 89 44 17 d9 48 89 f8 c3 f7 c7 0f 00 00 00 49 89 f8 48 89 44 17 f8 48 89 d1 75 0b 48 c1 e9 03 <f3> 48 ab 4c 89 c0 c3 31 d2 29 fa 83 e2 0f 48 89 07 48 89 47 08 48
[ 1017.746774] RSP: 002b:00007fb35face718 EFLAGS: 00010206
[ 1017.746776] RAX: 0000000000000000 RBX: 00007fb35fd21380 RCX: 0000000000081210
[ 1017.746777] RDX: 0000000003400000 RSI: 0000000000000000 RDI: 00007dadd8087000
[ 1017.746777] RBP: 00007dadd5090000 R08: 00007dadd5090080 R09: 00007dadd5090000
[ 1017.746778] R10: 0000000000004022 R11: 0000000000000202 R12: 0000000003200000
[ 1017.746779] R13: 0000000000000001 R14: 00007dadd5090080 R15: 0000000003200000
[ 1017.746781]  </TASK>
[ 1017.746782] memory: usage 786432kB, limit 786432kB, failcnt 3218
[ 1017.746784] swap: usage 0kB, limit 786432kB, failcnt 0
[ 1017.746785] Memory cgroup stats for /system.slice/docker-17bc55e952f676ec6e6945e090da8f27b766fac45b6c42363f364e292ed24a17.scope:
[ 1017.746839] anon 801067008
[ 1017.746840] file 0
[ 1017.746841] kernel 4239360
[ 1017.746841] kernel_stack 1081344
[ 1017.746842] pagetables 2101248
[ 1017.746842] sec_pagetables 0
[ 1017.746842] percpu 9672
[ 1017.746843] sock 0
[ 1017.746843] vmalloc 16384
[ 1017.746843] shmem 0
[ 1017.746844] zswap 0
[ 1017.746844] zswapped 0
[ 1017.746844] file_mapped 0
[ 1017.746845] file_dirty 0
[ 1017.746845] file_writeback 0
[ 1017.746846] swapcached 0
[ 1017.746846] anon_thp 765460480
[ 1017.746847] file_thp 0
[ 1017.746847] shmem_thp 0
[ 1017.746847] inactive_anon 674107392
[ 1017.746848] active_anon 126959616
[ 1017.746848] inactive_file 0
[ 1017.746849] active_file 0
[ 1017.746849] unevictable 0
[ 1017.746849] slab_reclaimable 175888
[ 1017.746850] slab_unreclaimable 818152
[ 1017.746850] slab 994040
[ 1017.746851] workingset_refault_anon 0
[ 1017.746851] workingset_refault_file 3757
[ 1017.746851] workingset_activate_anon 0
[ 1017.746852] workingset_activate_file 798
[ 1017.746852] workingset_restore_anon 0
[ 1017.746852] workingset_restore_file 797
[ 1017.746853] workingset_nodereclaim 0
[ 1017.746853] pgdemote_kswapd 0
[ 1017.746853] pgdemote_direct 0
[ 1017.746854] pgdemote_khugepaged 0
[ 1017.746854] pgpromote_success 0
[ 1017.746854] pgscan 4474
[ 1017.746855] pgsteal 4057
[ 1017.746855] pgscan_kswapd 0
[ 1017.746855] pgscan_direct 4474
[ 1017.746856] pgscan_khugepaged 0
[ 1017.746856] pgsteal_kswapd 0
[ 1017.746856] pgsteal_direct 4057
[ 1017.746857] pgsteal_khugepaged 0
[ 1017.746857] pgfault 110794
[ 1017.746858] pgmajfault 4078
[ 1017.746858] pgrefill 1093
[ 1017.746858] pgactivate 810
[ 1017.746859] pgdeactivate 0
[ 1017.746859] pglazyfree 0
[ 1017.746859] pglazyfreed 0
[ 1017.746860] swpin_zero 0
[ 1017.746860] swpout_zero 0
[ 1017.746860] zswpin 0
[ 1017.746861] zswpout 0
[ 1017.746861] zswpwb 0
[ 1017.746861] thp_fault_alloc 848
[ 1017.746862] thp_collapse_alloc 0
[ 1017.746862] thp_swpout 0
[ 1017.746862] thp_swpout_fallback 0
[ 1017.746863] numa_pages_migrated 0
[ 1017.746863] numa_pte_updates 0
[ 1017.746863] numa_hint_faults 0
[ 1017.746864] Tasks state (memory values in pages):
[ 1017.746864] [  pid  ]   uid  tgid total_vm      rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name
[ 1017.746865] [  25175]     0 25175      215       49        0       49         0    36864        0             0 tini
[ 1017.746869] [  25260]     0 25260 542927434   195358   195354        4         0  2064384        0             0 meilisearch
[ 1017.746871] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=docker-17bc55e952f676ec6e6945e090da8f27b766fac45b6c42363f364e292ed24a17.scope,mems_allowed=0,oom_memcg=/system.slice/docker-17bc55e952f676ec6e6945e090da8f27b766fac45b6c42363f364e292ed24a17.scope,task_memcg=/system.slice/docker-17bc55e952f676ec6e6945e090da8f27b766fac45b6c42363f364e292ed24a17.scope,task=meilisearch,pid=25260,uid=0
[ 1017.746966] Memory cgroup out of memory: Killed process 25260 (meilisearch) total-vm:2171709736kB, anon-rss:781416kB, file-rss:16kB, shmem-rss:0kB, UID:0 pgtables:2016kB oom_score_adj:0

3 comments

Sign in with Fluxer to comment and vote.
Comment by @mshaberle
RexSystem 1 vote originally by @mshaberle on GitHub OP
I was able to fix this on my end by upping the memory limits
FLUXER_MEILISEARCH_MEMORY_LIMIT=1536mb
FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=512mb
Comment by Hampus
HampusStaff 1 vote originally by @hampus-fluxer on GitHub
This should be fixed via #3153. Feel free to retest and close the issue if you can confirm it's fixed! Meilisearch indexes with half of the CPU cores it can see by default, and every indexing thread gets its own buffers on top of MAX_INDEXING_MEMORY. The container has no CPU limit, so on a many-core machine like yours it sees every core, and the indexer goes well past 768mb no matter what the indexing memory is set to. Queued indexing work survives restarts, which is why it kept getting OOM-killed every 13 to 15 minutes. The defaults are now:
  • FLUXER_MEILISEARCH_MAX_INDEXING_THREADS=2 (new)
  • FLUXER_MEILISEARCH_MEMORY_LIMIT=1536mb
  • FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=256mb
With those, a 300k message backlog indexed fine at about 1 GB peak in testing, while the old defaults were killed within seconds. The 8 GB and 4 GB host profiles in the docs were updated to match. The change is in the Compose files, so sh install.sh --update picks it up. If you've set your own limits, you can keep them and add the thread setting.