Use dogpile.cache.memcached in nova caching

According to the latest keystone configuration help,
dogpile.cache.memcached is more recommended option in TripleO
deployment than oslo_cache.memcache_pool, because it uses httpd+wsgi
to run apis and has less than 100 threaded servers.

This patch replaces backend used in nova caching, and also introduces
the new parameter tripleo::profile::base::nova::cache_backend so that
operators can use another backend if they want.

Change-Id: I36c0c474fb5e665392c1fb8d93dc3949ab6e8b67
This commit is contained in:
Takashi Kajinami 2020-03-28 15:46:08 +09:00
parent 991d52605c
commit 8d4ea840bf
2 changed files with 8 additions and 3 deletions

View File

@ -82,7 +82,11 @@
# (Optional) Enable the use of cache. Note that it is unsupported
# to disable this key. It is only useful for debugging purposes.
# Defaults to true
#
# [*cache_backend*]
# (Optional) Backend implementation to store cache
# Defaults to 'dogpile.cache.memcached'
#
class tripleo::profile::base::nova (
$bootstrap_node = hiera('nova_api_short_bootstrap_node_name', undef),
$oslomsg_rpc_proto = hiera('oslo_messaging_rpc_scheme', 'rabbit'),
@ -100,6 +104,7 @@ class tripleo::profile::base::nova (
$step = Integer(hiera('step')),
$memcached_ips = hiera('memcached_node_ips'),
$enable_cache = true,
$cache_backend = 'dogpile.cache.memcached',
) {
if $::hostname == downcase($bootstrap_node) {
@ -126,7 +131,7 @@ class tripleo::profile::base::nova (
include nova::logging
class { 'nova::cache':
enabled => $enable_cache,
backend => 'oslo_cache.memcache_pool',
backend => $cache_backend,
memcache_servers => $memcache_servers,
}
class { 'nova':

View File

@ -55,7 +55,7 @@ describe 'tripleo::profile::base::nova' do
is_expected.to contain_class('nova::logging')
is_expected.to contain_class('nova::cache').with(
:enabled => true,
:backend => 'oslo_cache.memcache_pool',
:backend => 'dogpile.cache.memcached',
:memcache_servers => ['127.0.0.1:11211']
)
is_expected.to contain_class('nova::placement')