Describe the bug
For a while we regularly had some nodes becoming unready at the same time every day leading to a lot of pods being killed.
After some investigations we found out that it was the /etc/cron.daily/mlocate script executed each day at 06:25 that was CPU starving the nodes.
Removing mlocate from the nodes fixed the problem.
For reference, on a 16.04-LTS VM:
$ sudo cat /etc/cron.daily/mlocate
#! /bin/bash
set -e
[ -x /usr/bin/updatedb.mlocate ] || exit 0
if which on_ac_power >/dev/null 2>&1; then
ON_BATTERY=0
on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
if [ "$ON_BATTERY" -eq 1 ]; then
exit 0
fi
fi
# See ionice(1)
if [ -x /usr/bin/ionice ] &&
/usr/bin/ionice -c3 true 2>/dev/null; then
IONICE="/usr/bin/ionice -c3"
fi
flock --nonblock /run/mlocate.daily.lock $IONICE /usr/bin/updatedb.mlocate
@anhvoms What are the effects of disabling the above? And, is it practical to do so, will background (e.g., walinuxagent) processes re-pave this configuration even if we manually remove it?
@jackfrancis mlocate indexes files so that they can be quickly located using the "locate" command. On some systems it can be taxing on CPU and IO. I don't think walinuxagent has anything to do with it.
@anhvoms thank you, so it's basically something that can be optionally removed
@johnsonshi as well in case you have any different conclusions