How to respond when an Elasticsearch query takes too long (PEGA0054 alert)

A PEGA0054 alert occurs when the elapsed time for a search query against the Elasticsearch index exceeds the system default threshold. The alert helps system administrators to identify search queries that reference a large number of search results, and helps developers and end users to avoid using them.

Alert log message

The alert log message indicates that the query operation exceeded the operation time threshold in milliseconds), and then displays the query that generated the alert, as in the following example:

Elasticsearch query took more than alert threshold of 500 ms: 638 ms SearchQuery: { "from" : 0, "size" : 50, "query" : { "filtered" : { "query" : { "query_string" : { "query" : "ASTERISKpzlpsearchmanagerluceneASTERISK", "default_field" : "_instancename", "default_operator" : "and", "allow_leading_wildcard" : true, "analyze_wildcard" : true } }, "filter" : { "fquery" : { "query" : { "query_string" : { "query" : "( pyRuleSet:Admin@es OR pyRuleSet:PegaDeveloper OR pyRuleSet:C3PO OR pyRuleSet:C3POInt OR pyRuleSet:Es OR pyRuleSet:EsInt OR pyRuleSet:Pega-BIX OR pyRuleSet:C3POFW OR pyRuleSet:C3POFWInt OR pyRuleSet:Pega-ProcessCommander OR pyRuleSet:Pega-LP-ProcessAndRules OR pyRuleSet:Pega-LP-Integration OR pyRuleSet:Pega-LP-Reports OR pyRuleSet:Pega-LP-SystemSettings_Branch_ES-1 OR pyRuleSet:Pega-LP-SystemSettings OR pyRuleSet:Pega-LP-UserInterface OR pyRuleSet:Pega-LP-OrgAndSecurity OR pyRuleSet:Pega-LP-DataModel OR pyRuleSet:Pega-LP-Application OR pyRuleSet:Pega-LP OR pyRuleSet:Pega-UpdateManager OR pyRuleSet:Pega-SecurityVA OR pyRuleSet:Pega-Feedback OR pyRuleSet:Pega-AutoTest OR pyRuleSet:Pega-AppDefinition OR pyRuleSet:Pega-ImportExport OR pyRuleSet:Pega-LocalizationTools OR pyRuleSet:Pega-RuleRefactoring OR pyRuleSet:Pega-ProcessArchitect OR pyRuleSet:Pega-Portlet OR pyRuleSet:Pega-Content OR pyRuleSet:Pega-IntegrationArchitect OR pyRuleSet:Pega-SystemArchitect OR pyRuleSet:Pega-Desktop OR pyRuleSet:Pega-EndUserUI OR pyRuleSet:Pega-Social OR pyRuleSet:Pega-EventProcessing_Branch_ES-1 OR pyRuleSet:Pega-EventProcessing OR pyRuleSet:Pega-Reporting OR pyRuleSet:Pega-UIDesign OR pyRuleSet:Pega-Gadgets OR pyRuleSet:Pega-UIEngine OR pyRuleSet:Pega-ProcessEngine OR pyRuleSet:Pega-SearchEngine_Branch_ES-1 OR pyRuleSet:Pega-SearchEngine OR pyRuleSet:Pega-IntegrationEngine OR pyRuleSet:Pega-RulesEngine_Branch_ES-1 OR pyRuleSet:Pega-RulesEngine OR pyRuleSet:Pega-Engine OR pyRuleSet:Pega-ProCom OR pyRuleSet:Pega-IntSvcs OR pyRuleSet:Pega-WB OR pyRuleSet:Pega-RULES ) AND NOT _isexternal:true", "default_field" : "_instancename", "default_operator" : "and", "allow_leading_wildcard" : true } }, "_cache" : false } } } }, "fields" : "ASTERISK"}

Operation time threshold

The threshold is established in the following prconfig.xml setting:

<env name="alerts/search/operationtime_threshold" value="500" />

What to do

Examine the text of the alert message, which provides the Elasticsearch query that exceeded the system threshold.

To avoid a query that might generate this alert, choose search settings that improve the performance of the search. For example:

 

Definitions alert log, prconfig.xml file
Related topics Understanding alerts

UpSysAdmin category