I particularly like the -cache_keys parameter available
Well, the db_interface with "-cache_key" iis not a recommended interface, since this does not scale and leads to many locks. Flushing of this cache is brute-force or not happening at all. In the sketched case - as you noted -, the cache has to be flushed (in the full cluster) whenever a new package is enabled (or installed) or disabled.
If you do not care about getting proper results in these situations, one can use the version below on oacs-5-10, which will be a lock free cache (not flushed as well).
one proc that I noticed gets called a lot ...
Why is apm_get_installed_versions gets called a lot on your site. On stock instances, this is only called by the package installer...
-g
ad_proc -public apm_get_installed_versions {
-array:required
} {
Sets the current installed version of packages installed on this system
in an array keyed by package_key.
@param array Name of array in caller's namespace where you want this set
} {
upvar 1 $array installed_version
array set installed_version [acs::per_thread_cache eval -key acs-tcl-apm_get_installed_versions {
db_list_of_lists -cache_key installed_packages installed_packages {
select package_key, version_name
from apm_package_versions
where enabled_p = 't'
}
}]
}