Merge "Add detail description of image_cache_max_size"

This commit is contained in:
Jenkins 2015-02-12 11:35:45 +00:00 committed by Gerrit Code Review
commit 803c54051b
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``
configuration file option. However, when images are successfully returned
from a call to ``GET /images/<IMAGE_ID>``, the image cache automatically
writes the image file to its cache, regardless of whether the resulting
write would make the 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.
configuration file option). The ``image_cache_max_size`` is an upper limit
beyond which pruner, if running, starts cleaning the images cache.
However, when images are successfully returned from a call to
``GET /images/<IMAGE_ID>``, the image cache automatically writes the image
file to its cache, regardless of whether the resulting write would make the
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``
at a regular interval.

View File

@ -22,7 +22,8 @@ image_cache_dir = /var/lib/glance/image-cache/
# stalled and eligible for reaping
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
# Address to find the registry server

View File

@ -39,7 +39,9 @@ image_cache_opts = [
cfg.StrOpt('image_cache_driver', default='sqlite',
help=_('The driver to use for image cache management.')),
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
help=_('The amount of time to let an image remain in the '
'cache without being accessed.')),