Add detail description of image_cache_max_size

The description of 'image_cache_max_size' was ambiguous. There was not
the certainty that the 'image_cache_max_size' parameter was about the
aggregate size of the cache or a per image limit.
The 'image_cache_max_size' is an upper limit beyond which pruner,
if running, starts cleaning the images cache.
Hence added detail description of 'image_cache_max_size' in document
and configuration file.

Bug: #1411813
Change-Id: Ide8e087db544aeea1990bac92c97cb9ca9f0b522
This commit is contained in:
Yusuke Ide 2015-02-03 23:07:25 +09:00
parent 18c1efa1be
commit 4f64c00547
3 changed files with 13 additions and 8 deletions

View File

@ -38,12 +38,14 @@ Controlling the Growth of the Image Cache
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The image cache has a configurable maximum size (the ``image_cache_max_size`` The image cache has a configurable maximum size (the ``image_cache_max_size``
configuration file option. However, when images are successfully returned configuration file option). The ``image_cache_max_size`` is an upper limit
from a call to ``GET /images/<IMAGE_ID>``, the image cache automatically beyond which pruner, if running, starts cleaning the images cache.
writes the image file to its cache, regardless of whether the resulting However, when images are successfully returned from a call to
write would make the image cache's size exceed the value of ``GET /images/<IMAGE_ID>``, the image cache automatically writes the image
``image_cache_max_size``. In order to keep the image cache at or below this file to its cache, regardless of whether the resulting write would make the
maximum cache size, you need to run the ``glance-cache-pruner`` executable. image cache's size exceed the value of ``image_cache_max_size``.
In order to keep the image cache at or below this maximum cache size,
you need to run the ``glance-cache-pruner`` executable.
The recommended practice is to use ``cron`` to fire ``glance-cache-pruner`` The recommended practice is to use ``cron`` to fire ``glance-cache-pruner``
at a regular interval. at a regular interval.

View File

@ -22,7 +22,8 @@ image_cache_dir = /var/lib/glance/image-cache/
# stalled and eligible for reaping # stalled and eligible for reaping
image_cache_stall_time = 86400 image_cache_stall_time = 86400
# Max cache size in bytes # The upper limit (the maximum size of accumulated cache in bytes) beyond
# which pruner, if running, starts cleaning the images cache.
image_cache_max_size = 10737418240 image_cache_max_size = 10737418240
# Address to find the registry server # Address to find the registry server

View File

@ -39,7 +39,9 @@ image_cache_opts = [
cfg.StrOpt('image_cache_driver', default='sqlite', cfg.StrOpt('image_cache_driver', default='sqlite',
help=_('The driver to use for image cache management.')), help=_('The driver to use for image cache management.')),
cfg.IntOpt('image_cache_max_size', default=10 * units.Gi, # 10 GB cfg.IntOpt('image_cache_max_size', default=10 * units.Gi, # 10 GB
help=_('The maximum size in bytes that the cache can use.')), help=_('The upper limit (the maximum size of accumulated '
'cache in bytes) beyond which pruner, if running, '
'starts cleaning the images cache.')),
cfg.IntOpt('image_cache_stall_time', default=86400, # 24 hours cfg.IntOpt('image_cache_stall_time', default=86400, # 24 hours
help=_('The amount of time to let an image remain in the ' help=_('The amount of time to let an image remain in the '
'cache without being accessed.')), 'cache without being accessed.')),