Starting Situation
- The PowerShell CLI 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 PowerShell 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-JobChain /some_folder/some_job_chain | Get-Job | Get-Task | Stop-Task
- 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-Status
andShow-Status
cmdlets. Subsequent calls to these cmdlets update the cache. The cache is available for the following cmdlets:
- The
Get-Task
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.
- Use of the cache can be deactivated with
- the
User-Master
cmdlet and the-NoCache
switch; - the
Get-Status
cmdlet and the-NoCache
switch.
- the
- The
Get-Task
cmdlet by default does not make use of the cache.