Personal tools
You are here: Home Documentation Installer Documentation LAS Administration Managing the LAS Cache
Document Actions

Managing the LAS Cache

by roland — last modified 2008-08-12 13:18

Whenever possible LAS keeps a cached copy of the products it generates so they can be reused. LAS manages the cache automatically, but there is an Web interface where you can check the state of the cache and manage its contents. This page describes the CacheManager web interface.

The Cache

When LAS creates a product it writes the files that make up the product to a special directory which is visible to the outside via the Tomcat server.  This is how the browser loads the results of a product request into the browser for the user to see. When the product is created, LAS makes an entry into an internal cache data structure.  When a new request comes in, LAS first consults the cache to see if the product already exists and if it does, it uses immediately returns the result to the client making the request and the client can pick up the results from the output directory.

The cache is managed internally using Least Recently Used algorithm with limits on both the number of files in the cache and the total size of the cache.  The $LAS_HOME/conf/server/productserver.xml file is consulted when LAS starts to determine the size of the cache.  The cache object is defined by this entry:

<cache size="1500" bytes="1024Mb" file="/home/tomcat/webapps/baker/output/cache.obj"/> 

where size is the maximum number of files allowed in the cache.  The bytes attributes is the total number of bytes allowed in the cache and the file attribute is where the cache entries are saved when the server is shutdown.  The bytes attribute can be in Bytes (bytes=2000000) or MegaBytes (bytes=1024Mb) if the "Mb" abbreviation is included in the attribute value.  When actions are performed on the cache it checks to see if 75% of the total number of bytes or total number of files limit has been reached.  If not, new objects can be added.  Potentially these new objects will take the cache size over the 75% limit, but next time something is to be added older entries will be removed to make room.  This will allow the cache to grow and shrink as needed, but will virtually guarantee that it never grows bigger than the configured limits.  If a new object is about to be added, and the cache is at its limit, the oldest cache entry will be removed until there is room for the new object.

The cache will be maintained across stops and starts as long as Tomcat is shutdown gracefully each time it is stopped (via the $LAS_HOME/stopserver.sh) or similar.

The CacheManager Interface

After you have enabled access to the admin pages by following these instructions, browse to http://yourserver/las/CacheManager.do to see the contents of the cache along with a summary of the number of files and the total size of the cache.  From this page you can clean the entire cache using the button at the top, or you can remove the files associated with a particular data set by selecting the button under where the files for that data set are listed.



Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: