PeopleSoft LOADCACHE Propagation
Dec 30, 2024When dealing with PeopleSoft environments, the performance and responsiveness of the application can be heavily impacted by how well the application servers are cached. As administrators, we have a few options when configuring cache settings for an application server, each with pros and cons.
Default Cache
The most common approach is to rely on the default cache settings, where each app server independently builds and maintains its own cache as users access different components. While this works, it can lead to inconsistent performance across servers and slower initial page loads.
Preload Cache
Another option is to use Preload Cache Projects. With this approach, an admin creates a project containing commonly used definitions that get loaded into cache. There is a setting for PreloadCache
which is used by the Preload Cache
option in PSADMIN
. This is intended for use with new domains that have no cache built. The PreloadMemoryCache
setting is used every time a PSAPPSRV
process starts. This will load into memory all definitions from the project that it can in 60 seconds before it times out.
Shared Cache
Yet another strategy is to implement shared caching. This approach is intended to be used with the LOADCACHE Application Engine. Where the default non-shared cache option uses individual cache directories tied to PSAPPSRV processes(CACHE/PSAPPSRV_1
, CACHE/PSAPPSRV_n
), the shared option uses a single shared directory(CACHE/SHARE
). The idea is to run LOADCACHE
and then copy the generated cache files into the shared directory. This approach comes with its own challenges around cache invalidation and code deployments.
LOADCACHE Propagation
There is a hybrid approach we use at psadmin.io that we call LOADCACHE Propagation. With this approach we try to combine aspects of Preload Cache
and Shared Cache
. The idea for this method started from a presentation given at psadmin.conf 2020 by Victor Frank. His approach to propagating generated cache files to other application server domain’s CACHE
directories was a great idea. Dan Iverson then refined this approach with usage of the LOADCACHE
program and took it to some psadmin.io client sites. After the success of that and some lessons learned, we have now created a utility to help document and manage this in a standardized approach.
How it works
With this approach, we run the LOADCACHE
process to generate cache files and then we copy them to each PSAPPSRV’s cache directory for each domain. There is a difference between this hybrid approach and the standard Shared Cache Mode that PeopleSoft documents.
To start, you do not enable the Shared Cache Mode in your domains. That mode turns off the application server from checking if the cache is valid; it just assumes the cache files are up to date. That does greatly speed up the pages, but if you migrate code into the environment the application server won't know about it. Also, that assumes there is one CACHE folder for all the PSAPPSRV processes. Instead, you leave the cache mode as default (non shared cache) and copy pre-built cache files into each PSAPPSRV cache directory.
This approach essentially fools the system into thinking that we have visited every page/component, but it will still do VERSION checks on objects to see if the cache files are up-to-date. So, this hybrid approach gives the benefit of pre-loading cache files, but also allows for migrating objects into an environment without having to rebuild cache every time.
Considerations
There are costs to this, and the obvious one is disk space. We are caching all definitions for every PSAPPSRV, for every domain. This can add up for large deployments but disk is generally cheap, so it could be worth it for faster, consistent performance. Also, keep in mind LOADCACHE
can take a while to run the first time(60-90 minutes?). However, after that it will run quicker, as it is just capturing definitions that have changed since the last run(~10 minutes?).
Using pscachier
To make this easier, we have created a PeopleSoft cache tool we call pscachier. This tool will assist admins when dealing with cache. As of the initial release, there is support for this LOADCACHE Propagation approach. The goal will be to add more features, including working with web cache, in the future.
$ pscachier app --help
Usage: pscachier app [OPTIONS] COMMAND [ARGS]...
Working with Application Server cache
Options:
--help Show this message and exit.
Commands:
copycache Copy generated cache to PSAPPSRVs
loadcache Run the LOADCACHE program to generate cache
Here are the steps for installing and using this tool.
-
Install this tool on one of your app servers.
# Install as psadm2 sudo su - psadm2 git clone https://github.com/psadmin-io/pscachier.git cd pscachier python -m pip install --user . # Display help export PATH=$PATH:~/.local/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PS_HOME/python/lib pscachier --help
-
Load cache for this environment.
export DATABASE="FSCMPUM" export PS_SERVDIR="/share/psoft/loadcache/$DATABASE" export PSC_USER="PS" export PSC_PASS="PS" export PSC_CONN_ID="people" export PSC_CONN_PW="peop1e" pscachier app loadcache \ --database $DATABASE \ --ps-servdir $PS_SERVDIR
-
On all your app servers, copy cache for each application server domain.
export DOMAIN="APPDOM" export PS_SERVDIR="/share/psoft/loadcache/$DATABASE" pscachier app copycache \ --domain $DOMAIN \ --ps-servdir $PS_SERVDIR
-
Restart your application server domains and you are done!