PEGA0020 alerts indicates poor performance of RULE-CONNECT-REST
After a system update to Pega 7.1.9 from Pega 7.1.7, it was observed that response time of a specific use case is 30% slower than Pega 7.1.7.
RULE-CONNECT-REST rules observed by PEGA0020 alerts indicated poor performance.
The observable difference was in pxConnectInMapReqElapsed which is worse by about 250 ms.
Steps to Reproduce
Configure an application with Connect-REST connector to retrieve data from an external web service.
A defect in Pegasystems’ code or rules. The issue is identifiable by high values of the pxConnectInMapReqElapsed metric reported by PEGA0020 alerts.
RULE-CONNECT-REST MYCO-INT-MYRESTCONNECTOR MYRESTCONNECTOR #20151201T152751.519 GMT has exceeded the threshold of 100 ms: 893 ms;pxConnectOutMapReqElapsed=0;pxConnectClientResponseElapsed=199;pxConnectInMapReqElapsed=316;
A un-optimized JSON mapping strategy is causing the performance issue. The code iterates through all the properties in the target mapping class to check the property qualifier in each property and compare it against the JSON field in the incoming response.
The below SQL Query is executed multiple times which cause the performance problem.
SELECT pyPropertyName AS "pyPropertyName", pyPageClass AS "pyPageClass", pyPropertyMode AS "pyPropertyMode" FROM RULES.pr4_rule_property "property" WHERE (pxObjClass = 'Rule-Obj-Property') AND (pyClassName = ?) AND (pyRuleAvailable = 'Yes').