The CPUTIME threshold specifies the maximum amount of combined user and system processor time that an activity can use on a particular member while the activity is running. Use this threshold to detect and control activities that are using excessive processor resources.
The amount of processor time that an activity spends running is measured from the time that the activity begins running at the member, after any queuing by thresholds, until the time that the activity finishes running.
Activities that are initiated by the database manager through a utility or procedure, with the exception of the ADMIN_CMD procedure, are not counted for this condition. The data server considers IMPORT, EXPORT, and other CLP commands to be user logic. Activities that are invoked from within IMPORT, EXPORT, and other CLP commands are subject to thresholds. Child activities of the LOAD command are not tracked by this threshold.
The following example creates a CPUTIME threshold TH1 for the database domain with a member enforcement scope. This threshold stops any activity that takes longer than 30 seconds to run, which it checks for at 5-second intervals. You can use this threshold to ensure that no queries on the system use an unreasonable amount of processor time, which can negatively impact other work running on the system.
CREATE THRESHOLD TH1 FOR DATABASE ACTIVITIES
ENFORCEMENT MEMBER
WHEN CPUTIME > 30 SECONDS CHECKING EVERY 5 SECONDS
STOP EXECUTION;