How to set size and time reporting limits for reports
Summary
The size and execution time of database queries can be limited by modifying database activity threshold parameters. For reports, you can issue a warning alert or generate an error alert when the size of report data exceeds a threshold. This helps you design efficient queries and guards against a report consuming all the system memory. You can also set a warning threshold for the time a report takes to execute. This article shows you how to modify the file to specify size and time limitations that initiate warning and error reports to PegaRULES-Alert logs.
For more information about the PEGA0004 alert, see Understanding the PEGA0004 alert - Quantity of data received by database query exceeds limit.
Suggested Approach
Setting size thresholds for a report query
- Stop the Process Commander server.
- Open the
prconfig.xml
file. For Tomcat installations, this file is located in theservername/webapps/prweb/WEB-INF/classes
folder. - Locate the
interactionByteThreshold
parameters. - Set the
enabled
entry to true. This enables the byte threshold function. - Set a value in megabytes for the
warnMB
entry. This writes a warning line to the PegaRULES-ALERT log file when the value is exceeded. The default value is 50 MB. The warning alert ID is PEGA0004. - Set a value in megabytes for the
errorMB
entry. This stops the server requestor and displays an alert error message in the user interface when the value is exceeded. It also generates an error message and stack trace in the PegaRULES-ALERT log file. By default, this entry is disabled with a value of -1 MB. The error alert ID is PEGA0004. - In the
warntraceback
entry, set the value to false to include the stack trace in the PegaRULES-ALERT log file when thewarnMB
value is exceeded. - Use the following code as an example of typical threshold values:
<env name="alerts/database/interactionByteThreshold/enabled" value="true" />
<env name="alerts/database/interactionByteThreshold/warnMB" value="50" />
<env name="alerts/database/interactionByteThreshold/errorMB" value="100" />
<env name="alerts/database/interactionByteThreshold/warntraceback" value="false" />
- Save the
prconfig.xml
file. - Restart the server server.
- Test the thresholds by running an operation that will trigger an alert. The figure shows an example of an alert error message triggered by the number of database bytes exceeding the threshold.
- To view the PegaRULES-ALERT log file, choose Tools > Log Files. Then click on the log file name. Example of the PegaRULES-ALERT log file.
- To view your alerts only, choose Tools > My Alerts and expand the line that contains the alert information. Example of a warning alert log entry using the My Alerts feature.
Setting a time threshold for a report query
- Open the
prconfig.xml
file. - Locate the
operationTimeThreshold
parameter. - Set a value in milliseconds for the
operationTimeThreshold
entry. This will write a warning in the PegaRULES-ALERT log file when the value is exceeded. The default value is 500 ms. The alert IDs generated by this warning can be PEGA0005, PAGA0006, or PEGA0007. Use the following code as an example:
- Open the
<env name="alerts/database/operationTimeThreshold" value="500" />
- Save the
prconfig.xml
file. - Restart the Process Commander server.