Flushing PPM Cache with kRunCacheManager.sh and ksc_flush_cache
There are two ways to flush a PPM Cache in a manual or automated way:
kRunCacheManager.sh (command line tool), or
ksc_flush_cache (special command). They should be called after modifying the data directly in the database without going through one of the supported PPM interfaces (Web UI, SOAP Web Service, REST Web Service, and so on).
kRunCacheManager.sh is a shell script that is run from the command line.
It works with both legacy cache and new cache.
sh ./kRunCacheManager.sh [<URL>] <cache number>
“URL” parameter is optional. If omitted, it will connect to the first running RMI_URL defined in
server.conf. You can pass multiple RMI urls, separated with semicolons (;), and it will connect to the first running one. It is safe to omit this parameter unless you want to connect to a specific PPM node, for example to reset cache statistics or request a garbage collection.
“Cache Number” parameter is the number next to the cache that you want to flush. In order to view the list of caches with their numbers, run the command without any parameter to list all caches and be prompted for possible options. You can also input a letter to trigger the following actions:
A: Flush All Caches. It is strongly advised not to use this option when running
kRunCacheManagerin an automated way.
B: Flush Validation Caches. This will only flush the validation related caches. It can be used when validation definition or values are directly edited in PPM database.
C: Reset Cache Statistics Counters. This only affects the node you are connected to.
D: Force Garbage Collection.
Issues and Limitations
The order of the caches in the list is not consistently enforced and can vary between environments or PPM versions. As a result, if you flush a specific cache designated by its number in a script, it is possible that the corresponding cache may change at some point in the future. You should verify that the cache numbers haven’t changed after every PPM upgrade or environment change.
It is not possible to flush only one entity in a cache; the whole cache has to be flushed. This can result in performance impact as all objects from the flushed cache will need to be reloaded. This could have performance impact under heavy load if some caches are flushed too often.
It is strongly advised NOT to use the “flush all caches” option (“
kRunCacheManager.sh A”) in an automated way, as it may have performance impact under heavy system load.
If the cache is flushed using
kRunCacheManager.shwhile the cache maintenance thread is running (it runs every 10 seconds by default), an exception may be fired and the
kRunCacheManager.shcache flush action may be ignored.