From dd905b90768b26b5a5a46225682928bed3a6fcce Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Thu, 1 May 2014 23:33:09 -0400 Subject: [PATCH] Improve mod_disk_cache support * Removed htcacheclean cron job since apache used cache cleaning daemon * Set size of disk cache to 1G instead of 300M * Allow files up to ~15M to be cached --- debian/hcoop-apache-clean-cache | 5 ----- debian/hcoop-apache2-config.displace | 1 + ...ache2-config.hcoop-apache-sync-logs.cron.d | 5 ----- debian/hcoop-apache2-config.transform | 1 + debian/rules | 3 --- files/mods-available/disk_cache.conf.hcoop | 22 +++++++++++++++++++ 6 files changed, 24 insertions(+), 13 deletions(-) delete mode 100644 debian/hcoop-apache-clean-cache delete mode 100644 debian/hcoop-apache2-config.hcoop-apache-sync-logs.cron.d create mode 100644 debian/hcoop-apache2-config.transform create mode 100644 files/mods-available/disk_cache.conf.hcoop diff --git a/debian/hcoop-apache-clean-cache b/debian/hcoop-apache-clean-cache deleted file mode 100644 index b9a2cd0..0000000 --- a/debian/hcoop-apache-clean-cache +++ /dev/null @@ -1,5 +0,0 @@ -# /etc/cron.d/hcoop-apache-clean-cache: Clean the disk cache every 23 -# minutes. -MAILTO=logs@mire.hcoop.net - -*/23 * * * * root /usr/sbin/htcacheclean -n -t -p/var/cache/apache2/mod_disk_cache -l700M diff --git a/debian/hcoop-apache2-config.displace b/debian/hcoop-apache2-config.displace index 2196412..115d7b4 100644 --- a/debian/hcoop-apache2-config.displace +++ b/debian/hcoop-apache2-config.displace @@ -2,3 +2,4 @@ /etc/suphp/suphp.conf.hcoop /etc/apache2/mods-available/suphp.conf.hcoop /etc/apache2/mods-available/status.conf.hcoop +/etc/apache2/mods-available/disk_cache.conf.hcoop diff --git a/debian/hcoop-apache2-config.hcoop-apache-sync-logs.cron.d b/debian/hcoop-apache2-config.hcoop-apache-sync-logs.cron.d deleted file mode 100644 index 03658a3..0000000 --- a/debian/hcoop-apache2-config.hcoop-apache-sync-logs.cron.d +++ /dev/null @@ -1,5 +0,0 @@ -# /etc/cron.d/hcoop-apache-sync-logs: Copy apache logs to user -# homedirs every 20 minutes. -MAILTO=logs@hcoop.net - -0 */2 * * * root /afs/hcoop.net/common/etc/scripts/apache-sync-logs >/dev/null 2>&1 diff --git a/debian/hcoop-apache2-config.transform b/debian/hcoop-apache2-config.transform new file mode 100644 index 0000000..32cd06a --- /dev/null +++ b/debian/hcoop-apache2-config.transform @@ -0,0 +1 @@ +/etc/default/apache2.hcoop sed -e 's/^HTCACHECLEAN_SIZE=.*/HTCACHECLEAN_SIZE=1G/' \ No newline at end of file diff --git a/debian/rules b/debian/rules index b8f94e9..4b25e40 100755 --- a/debian/rules +++ b/debian/rules @@ -12,6 +12,3 @@ %: dh $@ --with=config-package -override_dh_installcron: - dh_installcron --name=hcoop-apache-sync-logs - diff --git a/files/mods-available/disk_cache.conf.hcoop b/files/mods-available/disk_cache.conf.hcoop new file mode 100644 index 0000000..ca77951 --- /dev/null +++ b/files/mods-available/disk_cache.conf.hcoop @@ -0,0 +1,22 @@ + +# cache cleaning is done by htcacheclean, which can be configured in +# /etc/default/apache2 + + # This path must be the same as the one in /etc/default/apache2 + CacheRoot /var/cache/apache2/mod_disk_cache + + # This will also cache local documents. It usually makes more sense to + # put this into the configuration for just one virtual host. + + #CacheEnable disk / + + # The result of CacheDirLevels * CacheDirLength must not be higher than + # 20. Moreover, pay attention on file system limits. Some file systems + # do not support more than a certain number of subdirectories in a + # single directory (e.g. 32000 for ext3) + CacheDirLevels 2 + CacheDirLength 1 + + # cache files up to ~15M + CacheMaxFileSize 17000000 + -- 2.20.1