Starting Situation
- The JobScheduler CLI module interacts with the JobScheduler Master to retrieve information about available objects such as jobs, job chains, orders etc.
- For environments with a large number of jobs, e.g. some 5000 jobs and more, repeatedly retrieving the available objects from the Master creates some overhead.
- The JobScheduler CLI provides a caching mechanism to reduce this overhead. Job-related objects are retrieved just once and are stored in a cache that is used for subsequent operations.
- The cache is not applicable if up-to-date information is required.
Use Cases
When to use the cache
- The cache improves the speed of a number of operations. This applies in particular to pipelined operations:
- Approx. increase in speed of 50% for single operations.
- Mulitplied increase in speed when using pipelined operations:
Get-JobSchedulerJobChain /some_folder/some_job_chain | Get-JobSchedulerJob | Get-JobSchedulerTask | Stop-JobSchedulerTask
- The pipelined operations force the JobScheduler Master to be accessed three times to retrieve the respective objects. Resolving objects by use of the cache improves speed tremendously.
- The cache is activated by default when using the
Get-JobSchedulerStatus
andShow-JobSchedulerStatus
cmdlets. Subsequent calls to these cmdlets update the cache. Running any of these cmdlets for cache enablement consumes approx. 30% more execution time than without the cache being updated. The cache is available for the following cmdlets:
- The
Get-JobSchedulerTask
cmdlet by default does not make use of the cache. However, it can be used with the-UseCache
switch to enforce cache usage.
When not to use the cache
- If up-to-date information is required then it is preferable not to use the cache, e.g. if job-related objects are added or removed on a timely basis.
- Use of the cache for all cmdlets can be deactivated with
- the
Use-JobSchedulerMaster
cmdlet and the-NoCache
switch; - the
Get-JobSchedulerStatus
cmdlet and the-NoCache
switch.
- the
- The
Get-JobSchedulerTask
cmdlet by default does not make use of the cache.