From f73456a12353fa6c2d7773c3c5ff2e12556ac515 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 16 Oct 2015 21:09:58 -0400 Subject: [PATCH] Enable mod_cache to do API server side caching This commit adds enabling mod_cache to the api server to enable some server side caching. We don't need to update the data in real time on the dashboard and performing some server side caching will improve the dashboard performance. It'll also decrease the load we'll put on that poor trove node in rax cloud we're running subunit2sql on. Change-Id: I61d862603306a36c3ec6cd74d000126155bb29d5 --- manifests/api.pp | 10 ++++++++++ templates/openstack-health-api.vhost.erb | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/manifests/api.pp b/manifests/api.pp index 38e3b21..527b133 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -66,4 +66,14 @@ class openstack_health::api( Exec['package-application'], ], } + if ! defined(Httpd::Mod['cache']) { + httpd::mod { 'cache': + ensure => present, + } + } + if ! defined(Httpd::Mod['cache_disk']) { + httpd::mod { 'cache_disk': + ensure => present, + } + } } diff --git a/templates/openstack-health-api.vhost.erb b/templates/openstack-health-api.vhost.erb index 1b82e42..3f7b260 100644 --- a/templates/openstack-health-api.vhost.erb +++ b/templates/openstack-health-api.vhost.erb @@ -23,5 +23,15 @@ WSGIPythonHome <%= scope.lookupvar("openstack_health::api::virtualenv_dir") %> Require all granted + + + CacheRoot "/var/cache/apache2/mod_disk_cache" + CacheEnable disk "/" + CacheDirLevels 5 + CacheDirLength 3 + CacheLock on + + + DocumentRoot <%= scope.lookupvar("openstack_health::api::api_dir") %>