Remove XFS filesystem from the daily mlocate cron job

This fix removes the XFS filesystem from the daily cron job.
It will help to remove unnecessary disk IO due to updatedb/mlocate
swift object indexing inside the /srv/node folders.

This fix is related to  https://review.openstack.org/#/c/308036/

Change-Id: I8bfa92003ce06ee4f065663e054cd2d04f458ec6
Closes-Bug: #1572307
This commit is contained in:
Bjoern Teipel 2016-04-27 08:00:39 -05:00
parent a1b49589fe
commit d64b20f438
3 changed files with 36 additions and 0 deletions

View File

@ -112,3 +112,13 @@
tags:
- swift-dirs
- swift-logs
- name: Configure mlocate for cron.daily
template:
src: "mlocate-crond-daily.sh.j2"
dest: "/etc/cron.daily/mlocate"
mode: "0755"
owner: "root"
group: "root"
tags:
- swift-crond

View File

@ -0,0 +1,21 @@
#! /bin/bash
# {{ ansible_managed }}
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 --prunefs xfs

View File

@ -0,0 +1,5 @@
---
fixes:
- The XFS filesystem is excluded from the daily mlocate crond job
in order to conserve disk IO for large IOPS bursts due to
updatedb/mlocate file indexing.