Job Scheduler rules
Job Scheduler is a background server process that runs activities on a periodic basis. In a multinode cluster, Job Scheduler rules can run on multiple nodes.
For better performance, monitoring and diagnostics, Job Scheduler rules replace advanced agents. You can use Job Scheduler rules to perform jobs that are configured to run at a particular time, such as system cleanup jobs.
- Multiple times a day
- Daily
- Weekly
- Monthly
- Yearly
If you configure your Job Scheduler rule to run on all the nodes in a cluster, you can also enable it to run at a startup.
- NodeCleaner and ClusterAndDBCleaner
-
By default, the Node Cleaner job scheduler runs standard Code-.pzNodeCleaner activity on all the nodes in the cluster and the Cluster And DB Cleaner job scheduler runs the standard Code-.pzClusterAndDBCleaner activity on only one node in the cluster, once every 24 hours for housekeeping tasks, which include purging the following items:
- Older records (instances) from log tables.
- Any requestors that have had no activity during at least 48 hours.
- Rows from the
pc_events
database table according to the EventsRetentionPeriod Dynamic System Setting (the default retention period is 90 days). - Any nodes that have not responded to the pulse for 30 days.
- Expired locks.
- Old usage data if usage tracking is enabled.
Optionally, you can add an activity that is similar to Code-.pzClusterAndDBCleaner to another job scheduler to purge outdated information and recover tablespace. Ensure that the job scheduler has access to the needed ruleset versions, and do not purge instances that are referenced in other tables.
You can change the idle requestor purge criterion to a value that is less than 48 hours by overriding the test in the called activity System-Requestor-Context.CleanupExpired. Once per day, this activity calls Log-Usage.UsageCleaner, which trims older rows of the
pr_perf_stats
table (corresponding to the Log-Usage class). This activity starts a stored procedure, passing a number of days to retain based on the value of the pxProcess.pxLogUsage RetentionPeriod property. The default is 30 days, which can be updated through an entry in the prconfig.xml file or in the Dynamic System Settings. - PersistNodeState and PersistClusterState
- These job schedulers are used to automatically persist system state data. Cluster data is persisted once a day. Node data is persisted on node start up. System state data is saved for 90 days and is purged by the ClusterAndDBCleaner job scheduler.
Job Scheduler management
Create job schedulers in Dev Studio. Use the Jobs landing page in Admin Studio to trace and override Job Scheduler rules in your application. To create and manage Job Scheduler rules, make sure you have the pzJobSchedulerAdministrator privilege. To view the list of job schedulers in your application, make sure you have the pzJobSchedulerObserver privilege.
For more information about the Job Scheduler rule, see Use Job Scheduler and Queue Processor rules instead of agents on Pega Community.