MongoDB install /sys/kernal/mm/ warning

I am trying to get mongodb installed on my machine and have run into an area where I feel out of my depth. The error that I am getting when attempting to run a mongod server suggests the following:

WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'

I feel a bit uncomfortable tinkering with kernal memory management without knowing for sure what effects it will have. Would appreciate any guidance here, or if someone has installed mongo on their machine, what the process was.

Here are the steps that got me to where I am in this installation process. Everything up to the point of the kernal warning I have done before on ubuntu machines. This kernal warning is new territory for me.

# start the server
# Err address already in use
sudo killall -15 mongod
# Err /data/db not found
sudo mkdir -p /data/db
# Err Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied
sudo chown -R mongodb:mongodb /data/db
sudo chown $USER /data/db
# Err WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'

I also came across this in my hunt for answers, though not sure how applicable it is to the PureOS:

I am on a Librem 13.

It’s a warning, not error, and what it tells you is that your DB performance may be impaired if you don’t disable THP.
However - the fact that you are running mongodb on a laptop means you are aware that your performance will be far from ideal so you can safely ignore this warning.
If you disable THP though other apps which prefer to allocate and access memory in big chunks may hit performance impact.

1 Like