From 6d3baec5d0894de17df9207302b35b382b931f73 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 18 Nov 2024 15:55:00 +0900 Subject: [PATCH] Enable caching Enable caching in heat, keystone and nova. These services are known to leverage caching for effective performance improvement. Change-Id: Ibbcdb9a46bf02057a3640d8260f76a13f94e3882 --- .../puppet/modules/packstack/manifests/heat.pp | 12 ++++++++++++ .../puppet/modules/packstack/manifests/keystone.pp | 12 ++++++++++++ .../puppet/modules/packstack/manifests/nova/api.pp | 1 + .../modules/packstack/manifests/nova/cache.pp | 14 ++++++++++++++ .../modules/packstack/manifests/nova/conductor.pp | 1 + .../modules/packstack/manifests/nova/sched.pp | 2 +- 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 packstack/puppet/modules/packstack/manifests/nova/cache.pp diff --git a/packstack/puppet/modules/packstack/manifests/heat.pp b/packstack/puppet/modules/packstack/manifests/heat.pp index fe02ee477..f395e08e7 100644 --- a/packstack/puppet/modules/packstack/manifests/heat.pp +++ b/packstack/puppet/modules/packstack/manifests/heat.pp @@ -15,6 +15,18 @@ class packstack::heat () workers => lookup('CONFIG_SERVICE_WORKERS'), } + $memcache_servers = lookup('CONFIG_IP_VERSION') ? { + 'ipv6' => ['[::1]:11211'], + default => ['127.0.0.1:11211'], + } + class {'heat::cache': + enabled => true, + backend => 'dogpile.cache.pymemcache', + memcache_servers => $memcache_servers, + } + include packstack::memcached + Class['memcached'] -> Anchor['heat::service::begin'] + $heat_cfg_ctrl_host = lookup('CONFIG_KEYSTONE_HOST_URL') class { 'heat::engine': diff --git a/packstack/puppet/modules/packstack/manifests/keystone.pp b/packstack/puppet/modules/packstack/manifests/keystone.pp index e70bf48aa..e174dfa1a 100644 --- a/packstack/puppet/modules/packstack/manifests/keystone.pp +++ b/packstack/puppet/modules/packstack/manifests/keystone.pp @@ -60,6 +60,18 @@ class packstack::keystone () region => lookup('CONFIG_KEYSTONE_REGION'), } + $memcache_servers = lookup('CONFIG_IP_VERSION') ? { + 'ipv6' => ['[::1]:11211'], + default => ['127.0.0.1:11211'], + } + class { 'keystone::cache': + enabled => true, + backend => 'dogpile.cache.pymemcache', + memcache_servers => $memcache_servers, + } + include packstack::memcached + Class['memcached'] -> Anchor['keystone::dbsync::begin'] + # default assignment driver is SQL $assignment_driver = 'keystone.assignment.backends.sql.Assignment' diff --git a/packstack/puppet/modules/packstack/manifests/nova/api.pp b/packstack/puppet/modules/packstack/manifests/nova/api.pp index aece41fde..1b5e49795 100644 --- a/packstack/puppet/modules/packstack/manifests/nova/api.pp +++ b/packstack/puppet/modules/packstack/manifests/nova/api.pp @@ -36,6 +36,7 @@ class packstack::nova::api () service_name => 'httpd', } + include packstack::nova::cache class { 'nova::metadata': neutron_metadata_proxy_shared_secret => lookup('CONFIG_NEUTRON_METADATA_PW_UNQUOTED', undef, undef, undef), } diff --git a/packstack/puppet/modules/packstack/manifests/nova/cache.pp b/packstack/puppet/modules/packstack/manifests/nova/cache.pp new file mode 100644 index 000000000..376715079 --- /dev/null +++ b/packstack/puppet/modules/packstack/manifests/nova/cache.pp @@ -0,0 +1,14 @@ +class packstack::nova::cache () +{ + $memcache_servers = lookup('CONFIG_IP_VERSION') ? { + 'ipv6' => ['[::1]:11211'], + default => ['127.0.0.1:11211'], + } + class { 'nova::cache': + enabled => true, + backend => 'dogpile.cache.pymemcache', + memcache_servers => $memcache_servers, + } + include packstack::memcached + Class['memcached'] -> Anchor['nova::service::begin'] +} diff --git a/packstack/puppet/modules/packstack/manifests/nova/conductor.pp b/packstack/puppet/modules/packstack/manifests/nova/conductor.pp index 5d8078662..0dc14a46a 100644 --- a/packstack/puppet/modules/packstack/manifests/nova/conductor.pp +++ b/packstack/puppet/modules/packstack/manifests/nova/conductor.pp @@ -1,5 +1,6 @@ class packstack::nova::conductor () { + include packstack::nova::cache class { 'nova::conductor': enabled => true, workers => lookup('CONFIG_SERVICE_WORKERS'), diff --git a/packstack/puppet/modules/packstack/manifests/nova/sched.pp b/packstack/puppet/modules/packstack/manifests/nova/sched.pp index df327787c..aed1a5007 100644 --- a/packstack/puppet/modules/packstack/manifests/nova/sched.pp +++ b/packstack/puppet/modules/packstack/manifests/nova/sched.pp @@ -1,7 +1,7 @@ class packstack::nova::sched () { + include packstack::nova::cache include nova::scheduler::filter - class { 'nova::scheduler': enabled => true, }