Performance Load Cache

30
Application Server Caching Benefits of Application Server (PSAPPSRV) Caching 1. Caching improves application performance 2. More predictable response when pre-loaded Types of Application Server (PSAPPSRV) Cache 1. Memory Cache – always enabled 2. File Cache – configurable

description

A good presentation on how the PeopleSoft LoadCache works and why it's a good performance enhancement.

Transcript of Performance Load Cache

Page 1: Performance Load Cache

Application Server Caching

• Benefits of Application Server (PSAPPSRV) Caching1. Caching improves application performance

2. More predictable response when pre-loaded

• Types of Application Server (PSAPPSRV) Cache1. Memory Cache – always enabled

2. File Cache – configurable

Page 2: Performance Load Cache

PSAPPSRV Cache Settings

• ServerCacheMode [0] - non-shared cache

cache files in $PS_HOME\appserv\domain\CACHE\PSAPPSRV_n

[1] - shared cache

revert to non-shared if cache not pre-loaded during boot

cache files in PS_HOME\appserv\domain\CACHE\SHARE

• EnableServerCaching[0] – none, [1] – most objects, [2] – all objects

• CacheBaseDir - base file cache directory for domain can be configured

Page 3: Performance Load Cache

PSAPPSRV Cache Settings

• MaxCacheMemory - maximum memory cache size in MBytes

- tradeoff between performance and available memory

- pruning disabled when set to 0

• PreloadFileCache - preload cache to file

• PreloadMemoryCache - preload cache to memory

Page 4: Performance Load Cache

PSAPPSRV Cache Objects

• Application Engine Program• Application Package• Component Interface• Business Process• Permission List • Content (images HTML etc)• File Layout Object• Menu• Application message Information

• Panel Information • Portal Registry Information• Record• Script Model (generated implicitly)• SQL repository• Stylesheet• Tree structures• User Profile• URL address• Etc.

Page 5: Performance Load Cache

PSAPPSRV File Cache Mode: Non-Shared

Page 6: Performance Load Cache

PSAPPSRV File Cache Mode: Non-shared (default)

• One cache directory per PSAPPSRV process in a domain• Cache files may be pre-loaded using loadcache program• Invalid cache will be updated • More space required for cache files• Cache Directory: $PS_HOME\appserv\domain\CACHE\

PSAPPSRV_n

** File cache items are not portable to different O/S.

Page 7: Performance Load Cache

PSAPPSRV File Cache Mode: Shared

Page 8: Performance Load Cache

PSAPPSRV File Cache Mode: Shared

• One cache directory for all PSAPPSRV processes in a domain• Cache must be preloaded• Invalid cache will not be updated • Run loadcache to update cache files• Cache Directory: $PS_HOME\appserv\domain\CACHE\

SHARE

** File cache items are not portable to different O/S.

Page 9: Performance Load Cache

Example of Changes That Invalidate Cache

• Metadata Changes• Design Changes• Upgrades• Patches• Updating PSSTATUS.LASTREFRESHDTTM (all cache items

will be marked as invalid)• etc.

Page 10: Performance Load Cache

LoadCache Program

• AE program use for preloading cache for the Application Server

• Run LoadCache program at least once for shared file cache implementation.

• Factors affecting Loadcache run time:• number of active languages• size of the database• performance of the machine

Page 11: Performance Load Cache

Improving LoadCache Run Time

1. Incremental Load ** Load staging directory with cache before

running the LoadCache program.

2. Reduce the number of active languages

3. Run Loadcache program in parallel

Page 12: Performance Load Cache

LoadCache: Incremental Load

• Incremental load is a built-in LoadCache feature

• Loadcache only updates changed/missing objects

• LoadCache can use any existing cache files

• Default target folder: $PS_HOME/appserv/prcs/<domain>/CACHE/CACHE/STAGE/stage

Page 13: Performance Load Cache

LoadCache: Incremental Load

Procedure:

• Use cache files from a previous LoadCache run or

existing application server cache files

• Copy them to the target folder for LoadCache and run the Loadcache program

Page 14: Performance Load Cache

LoadCache: Reduce the number of Active Languages

• Loadcache run time increased with additional languages

• Cache file sized increased with additional languages

• Methods for checking active languages: PeopleTools > Utilities > International > Languages in PIA select from the PSLANGUAGES table in the database (where installed = 1)

Considerations for inactivating additional languages:• make sure you only activate the languages you use• base language cannot be inactivated

Page 15: Performance Load Cache

LoadCache: Parallel Processing

• LoadCache creates cache files for 50 object types

• Default behavior is to load the files for each object type serially

• To enable parallel processing, must clone LoadCache program and change the following delivered LoadCache code:

  &array_MgrName = CreateArray("ACM", "AEM", "AES", "APM", "ATM", "BCM", "BPM", "CHDM", "CLM", "CRM", "ENTM", "ERSTM", "FDM", "FLM", "GTM", "IOM", "MDM", "MNDM", "MPM", "MSDM", "MSG", "NTM", "PBM", "PCM", "PDM", "PGM", "PRDM", "PRSM", "PRUF", "PRUH", "PSD", "PSJ", "PSR", "PSS", "PST", "RDM", "RSM", "RSTM", "SCM", "SPTM", "SRM", "SSM", "SUDM", "TSM", "UPM", "URL", "VAM", "XTM");

&ret = PreloadCache(&array_MgrName, &dirPath, /* purge existing cache = */ False);

Page 16: Performance Load Cache

LoadCache: Parallel Processing

Procedure:• Open the LoadCache AE program in App Designer

• Clone the LoadCache AE program and the AE PeopleCode

• Modify the manager name array so each clone of the LoadCache program would only load the cache files for certain object types

• Run these AE programs in parallel from the command line, or by using a Process Scheduler jobset.

Page 17: Performance Load Cache

LoadCache: Parallel Processing

CONSIDERATIONS: • Available server resource • Modifications to LoadCache program are necessary• Implicitly generated cache files• Redundant files• Copying of cache files from multiple folders

Page 18: Performance Load Cache

LoadCache Summary

• Incremental load is least intrusive and could provide the biggest savings

• Disabling unused languages would shorten LoadCache runtime

• Parallelizing/splitting the LoadCache program offers a more flexible way of preloading cache files, but more preparation/maintenance is necessary

Page 19: Performance Load Cache

New in PeopleTools 8.48

• PreloadFileCache and PreloadMemoryCache

• Involves creating a project containing commonly used components and then referring to these projects in the the psappsrv.cfg

• the parameters are commented out by default

Page 20: Performance Load Cache

PreloadFileCache / PreloadMemoryCache

• you can set the parameters to reference separate projects

• these projects will be stored in the database, like any other Peoplesoft project.

• the projects can be copied, exported etc. across databases and platforms.

Page 21: Performance Load Cache

Creating the Preload Projects

• First, select the components that you want to preload: PeopleTools > Utilities > Administration > Select Pre-load Components

Page 22: Performance Load Cache

Creating the Preload Projects

• Next, build the Preload Project: PeopleTools > Utilities > Administration > Create Pre-load Project

Page 23: Performance Load Cache

Creating the Preload Projects

• In general, it is recommended to create a large project for the PreloadFileCache setting and a small subset of components for the PreloadMemoryCache project.

• The optimum selections for the projects will require tuning and testing at your site.

Page 24: Performance Load Cache

PreloadFileCache

• intended to be used for a new domain, where the file cache is not yet built

• the domain starts a PSAPPSRV process, builds the file cache for the specified components and dependant records, and shuts down

Page 25: Performance Load Cache

PreloadFileCache

• PSAdmin then copies this cache file to the cache folder of the other appservers(the max configured for the domain), so that all the appservers will have the preloaded cache file available at startup

Page 26: Performance Load Cache

PreloadFileCache

• if the cache files are already present, the appserver will do an incremental load to add/update definitions to the cache files

• if PreloadFileCache is invoked and the ‘project name’ entry in psappsrv.cfg is empty, the appserver will exit indicating that the project is not found to preload the cache.

Page 27: Performance Load Cache

PreloadMemoryCache

• intended to be used during a server process recycle

• since the preloading of memory cache could increase the boot up time for the server, this feature is disabled during the server boot up

Page 28: Performance Load Cache

PreloadMemoryCache

• when an appserver process recycles, it loads memory cache based on the project specified by the PreloadMemoryCache parameter

• there is a timeout (or limit) of 60 seconds for PreloadMemoryCache - it preloads as many definitions as possible before the timeout

Page 29: Performance Load Cache

PreloadFileCache/PreloadMemoryCache FAQs

1. How do I find out the component name where that am using?

A: From the browser window while you are in the PIA page in question, press Control+J to get the Component Name.

2. How do I get the list of all PeopleSoft Components?

A: The components were called panel groups in older PeopleTools. Use this SQL statements to get the list:

select * from PSPNLGRPDEFN

Page 30: Performance Load Cache

PreloadFileCache/PreloadMemoryCache FAQs

3. Is there another way to get a list of critical components that I need?

A: If you use PeopleSoft Performance Monitor, use this SQL statement to get the list of components that end-user accesses.

select distinct PM_CONTEXT_VALUE1 from PSPMTRANSHIST where PM_TRANS_DEFN_ID in (401, 402, 403, 416) and PM_AGENTID in (select PM_AGENTID from PSPMAGENT where PM_SYSTEMID = <monitored_system_ID> and PM_AGENT_TYPE = 'PSAPPSRV')