From 7eb7e1157f4a1bfd4ddd7cd80f9269c86716ed55 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 23 Aug 2013 16:09:33 +0000 Subject: [PATCH] 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 --- modules/openstack_project/files/log_archive_maintenance.sh | 4 ++-- modules/openstack_project/manifests/static.pp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/openstack_project/files/log_archive_maintenance.sh b/modules/openstack_project/files/log_archive_maintenance.sh index 3824651544..143e5c8e6f 100644 --- a/modules/openstack_project/files/log_archive_maintenance.sh +++ b/modules/openstack_project/files/log_archive_maintenance.sh @@ -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 \ diff --git a/modules/openstack_project/manifests/static.pp b/modules/openstack_project/manifests/static.pp index ea54c4173c..018e0e57fd 100644 --- a/modules/openstack_project/manifests/static.pp +++ b/modules/openstack_project/manifests/static.pp @@ -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'],