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:
		@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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.')),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user