Support MEMOIZED_MAX_SIZE_DEFAULT option
... which was added in 15.0.0 (Stein) release[1]. [1] https://docs.openstack.org/horizon/latest/configuration/settings.html#memoized-max-size-default Change-Id: I2057f507c17e097795825d98d2aa234b0269138f
This commit is contained in:
parent
1dcc7f7df5
commit
9673af7d3f
|
@ -31,6 +31,10 @@
|
|||
# in vhost.conf.
|
||||
# Defaults to facts['networking']['fqdn'].
|
||||
#
|
||||
# [*memoized_max_size_default*]
|
||||
# (optional) Global default to help control memory usage when caching.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*cache_backend*]
|
||||
# (optional) Horizon cache backend.
|
||||
# Defaults: 'django.core.cache.backends.locmem.LocMemCache'
|
||||
|
@ -544,6 +548,7 @@ class horizon(
|
|||
$secret_key,
|
||||
$package_ensure = 'present',
|
||||
Boolean $purge_conf_d_dir = false,
|
||||
Optional[Integer[0]] $memoized_max_size_default = undef,
|
||||
$cache_backend = 'django.core.cache.backends.locmem.LocMemCache',
|
||||
$cache_options = undef,
|
||||
$cache_timeout = undef,
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The new ``horizon::memoized_max_size_default`` parameter has been added.
|
|
@ -93,6 +93,7 @@ describe 'horizon' do
|
|||
before do
|
||||
params.merge!({
|
||||
:purge_conf_d_dir => true,
|
||||
:memoized_max_size_default => 25,
|
||||
:cache_backend => 'django.core.cache.backends.memcached.MemcachedCache',
|
||||
:cache_timeout => 300,
|
||||
:cache_options => {'SOCKET_TIMEOUT' => 1,'SERVER_RETRIES' => 1,'DEAD_RETRY' => 1},
|
||||
|
@ -161,6 +162,7 @@ describe 'horizon' do
|
|||
" 'DEAD_RETRY': 1,",
|
||||
" 'SERVER_RETRIES': 1,",
|
||||
" 'SOCKET_TIMEOUT': 1,",
|
||||
"MEMOIZED_MAX_SIZE_DEFAULT=25",
|
||||
" 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',",
|
||||
" 'LOCATION': '10.0.0.1:11211',",
|
||||
" 'TIMEOUT': 300,",
|
||||
|
|
|
@ -175,6 +175,13 @@ ENFORCE_PASSWORD_CHECK = True
|
|||
# os.path.join(LOCAL_PATH, '.secret_key_store'))
|
||||
SECRET_KEY = secret_key.generate_or_read_from_file('<%= @secret_key_path %>')
|
||||
|
||||
<% if !@memoized_max_size_default.nil? -%>
|
||||
# MEMOIZED_MAX_SIZE_DEFAULT allows setting a global default to help control
|
||||
# memory usage when caching. It should at least be 2 x the number of threads
|
||||
# with a little bit of extra buffer.
|
||||
#MEMOIZED_MAX_SIZE_DEFAULT = 25
|
||||
MEMOIZED_MAX_SIZE_DEFAULT=<%= @memoized_max_size_default.to_s %>
|
||||
<% end -%>
|
||||
# We recommend you use memcached for development; otherwise after every reload
|
||||
# of the django development server, you will have to login again. To use
|
||||
# memcached set CACHES to something like
|
||||
|
|
Loading…
Reference in New Issue