Reduce log compression frequency and optimize

The I/O bandwidth starvation inflicted on static.openstack.org
during log compression and deletion runs is overwhelming the server
and preventing other activities from completing in a timely fashion.
Use optimization level 3 to hopefully improve performance of each
run, and schedule them to only run weekly around or shortly after
midnight Saturday mornings American time instead of every six hours.
Filesystems on static.openstack.org will also be increased in size
accordingly to provide more cushion for data to build up between
runs.

Change-Id: I0d9f0c4c1a254bbba2d1cbfca4603ceb34274f9d
This commit is contained in:
Jeremy Stanley 2013-08-23 16:09:33 +00:00
parent 467c388553
commit 7eb7e1157f
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
sleep $((RANDOM%600)) && \
flock -n /var/run/gziplogs.lock \
find /srv/static/logs/ -depth \
find -O3 /srv/static/logs/ -depth \
\( \
\( -type f -mmin +10 -not -name robots.txt \
-not -wholename /srv/static/logs/help/\* \
@ -12,7 +12,7 @@ find /srv/static/logs/ -depth \
-o \( -type d -not -name lost+found -empty -mtime +1 \
-execdir rmdir {} \; \) \
\)
find /srv/static/docs-draft/ -depth \
find -O3 /srv/static/docs-draft/ -depth \
\( \
\( -type f -mtime +30 -name \*.gz -execdir rm \{\} \; \) \
-o \( -type d -not -name lost+found -empty -mtime +1 \

View File

@ -135,7 +135,8 @@ class openstack_project::static (
cron { 'gziprmlogs':
user => 'root',
minute => '0',
hour => '*/6',
hour => '7',
weekday => '6',
command => 'bash /usr/local/sbin/log_archive_maintenance.sh',
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
require => File['/usr/local/sbin/log_archive_maintenance.sh'],