Sign inSign up

optimoz/mongodb-server

By optimoz

Updated over 2 years ago

The mongo daemon 7.0.11 only. Based on Rocky 9.4 with Bash, the Coreutils and other system tools

Image
Databases & storage
0

661

optimoz/mongodb-server repository overview

Kernel Parameters

Because mongodb is an in-memory database, there are some Kernel Parameters that must be set somehow. The best way do this varies according to your use case ( e.g. kubernetes vs. Docker Compose ). Two choices are to run the container privileged for docker, or possibly to dedicate a node to mongodb in kube, and set these K-params on the tainted worker node.

Here are the settings:

turn off THP

echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled && echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag

settings for /etc/sysctl.conf

check /proc/sys/fs/file-max

fs.file-max = 2097152

max_map_count

This file contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap and mprotect, and also when loading shared libraries. This is not the total memory mongod can have, but rather how many distinct regions in the heap that are available to mongod.

vm.max_map_count = 262144

No Swap

turn off swapping altogether if the container runtime's host has it on in the first place

vm.swappiness = 0

Running

podman run -it --rm -p 27017:27017 mongodb-server:7.0.11-0.5 /usr/bin/mongod -f /etc/mongod.conf

or:

podman run -it --rm -p 27017:27017 mongodb-server:7.0.11-0.5 /usr/bin/mongod --bind_ip_all

This image is not fully tested yet....

Tag summary

Content type

Image

Digest

sha256:59685adcf

Size

73 MB

Last updated

over 2 years ago

docker pull optimoz/mongodb-server:7.0.11-0.5