Pages

Saturday, August 18, 2012

Dynacache in WebSphere 7

Notes on Dynacache post and WebSphere doc on setting

Caching of too much data can cause performance issues and this makes sizing of the cache very important. Selecting a correct size of cache can be difficult and because of this an underutilized cache can occur. This problem is not easily solved  because Java does not have a size of operator that will tell us the size of a object on the heap.

Dynacache allows the administrator the ability to control the cache by setting high and low water marks on the heap size.



  • Dynamic Cache service setting can be found Servers - Server Types - WebSphere application servers - server name> Container services - Dynamic cache service
  • Service starts with caching is enabled in Web Container panel.
  • Cache size 
    • Positive integer  represents the maximum number of entries the cache can hold.
  • Default priority 
    • How long an entry stays in a full cache   
  • Limit memory cache size
    • Sets the size of the memory cache. Allows you to control the size of cache in terms of the JVM heap. 
    • The least recently used algorithm is used to remove items from cache. 
  • Memory Cache size
    • Allows you to set the cache in MB. 
    • High threshold and low threshold represent the high and low watermarks. 
      • expressed in terms of percentage of the memory cache

  • Enable disk offload

    • Allows items removed from memory to be moved to disk if needed later 
      • You CANNOT specify the number of items moved to disk
      • You CANNOT specify the amount of disk space to use.  
  • Offload location 
    • Location on disk to save entry's
      • Default ${WAS_TEMP_DIR}/node/server name/_dynacache/cache JNDI name  
        • ${WAS_TEMP_DIR} is install/temp dir
      • If location is specified then node, server name and cache instance name is appended
    • If you use the default dir and the server fills up WebSphere could stall
    • Depending on OS you may see disk full messages in the console. 
  • Flush to disk 
    • Indicates if in memory cache should be written to disk in the event that the app server is shutdown. 
  • Limit Disk size in GB
    • leaving blank indicates unlimited.
  • Limit disk size in entries
    • leaving blank indicates unlimited. 
  • Disk Cache Performance Settings (how memory resources should be used on background activity such as cache cleanup, expiration, garbage collection, and so on)
      • High - all metadata kept in memory
      • Balanced - some metadata kept, balance of performance and memory usage found
      • Low - limited metatdata is kept
      • Custom - Admin will explicitly configure memory setting 
        • Set with the  DiskCacheCustomPerformanceSettings  object
    • Disk Cache cleanup frequency 
      • set in minutes is set to 0 only happens at midnight. 
      • Only applies with Per Setting are low, balanced or custom
        • High does not require disk cleanup
    • Maximum buffer for cached identifiers per metaentry
      • Sets number of maximum number of cache identifiers that are stored for an individual dependency 
      • If limit exceeded data is off loaded to disk 
      • Only Applies to custom Per Setting 
    • Maximum buffer for dependency identifiers 
      • Sets the number of dependency identifier buckets in the disk cache metadata in memory.
      • Only Applies to custom Per Setting 
    • Maximum buffer for templates 
      • Only Applies to custom Per Setting 
      • Sets the max number of temp buckets
    •  Maximum buffer for templates 
      • sets the max  number of template buckets
      • Only Applies to custom Per Setting
  • Disk Cache eviction algorithm 
    • Only applies if disk offload is specified
      • None - once this disk cache reaches the disk size the service stops writing to disk
      • Random - 
      • Size - Largest are removed first
    • High Threshold 
      • Sets when the eviction policy runs
      • Percent of disk space
    • Low Threshold
      • Sets when the eviction policy ends
      • Percent of disk space
    • Enable Cache replication 
      • Uses cache replication to have cache entries copied to member of a replication domain
    • Full group replication domain
      • sets the replication domain
    • Replication type (Direct from IBM doc)
      • Specifies the global sharing policy for this application server.
      • The following settings are available:
        • Both push and pull sends the cache ID of newly updated content to other servers in the replication domain. Then, if one of the other servers requests the content, and that server has the ID of the cache entry for the previously updated content, it will retrieve the content from the publishing server. On the other hand, if a request is made for an ID which has not been previously published, the server assumes it does not exist in the cluster and creates a new entry.
        • Push only sends the cache ID and cache content of new content to all other servers in the replication domain.
        • When you use the Not Shared setting, as cache entries are created, neither the cache content nor the cache IDs are propagated to other servants or servers in the replication domain. However, invalidations are propagated to other servants or servers. You can set the sharing policy at different levels. A global sharing policy, which is the default policy for all caches, is defined when you configure the dynamic cache service. You can overwrite this sharing policy by modifying the cachespec.xml file. For more information on thecachespec.xml file, see the cachespec.xml file topic. Additionally, you can overwrite the sharing policy at the application programming interface (API) level when cache entries are being created.
        • The default is Not Shared.
    • Push frequency 
      • Time in seconds before new or modified cache entries are pushed to other servers

1 comment: