TIBCO Offer and Price Engine Performance Improvement

Scoring of models

The duration of loading the first request of OPE model is longer as a large amount of data is retrieved from Redis to the OPE local cache. To solve this issue, the scoring of models is introduced in this hotfix.

Before the first request is made, all the OPE models are assigned a default score (Default: 1). At OPE start-up, OPE loads models randomly and eliminates the time lag.

As per the usage of the models, the OPE models score increases. For subsequent OPE restarts, OPE loads the models in descending order of the model scores.

Note: Model scoring is available for the product, price, and discount models. To enable model scoring and ledger, you must set the enableProductScoringAndLedger, enablePriceScoringAndLedger, and enableDiscountScoringAndLedger properties value as true for Product, Price, and Discount models respectively in ConfigValues_Common.xml file.
Note: Model scoring is timer-based and you can configure the timer as per your requirement. The default value is two minutes. You can set the timer by updating scoreUpdaterDelayInMillis property value under "Fixed delay for running score updator" configuration in the ConfigValues_OPES.xml file.

Model ledger

The model ledger records the data about the model loading and compares the data with the cache. Ledger updater updates or removes the models in cache based on the comparison. The model ledger is flag-based and its default value is false.

Generally, for the long-lived cache, a model ledger is required and you can set the flag value to true.

Note: Model ledger is available for the product, price, and discount models. To enable model scoring and ledger, you must set the enableProductScoringAndLedger, enablePriceScoringAndLedger, and enableDiscountScoringAndLedger properties value as true for Product, Price, and Discount models respectively in ConfigValues_Common.xml file.

Also, when this property value is set as true, the purging APIs for ledger (/v1/discountLedger, /v1/priceLedger, /v1/productLedger) are enabled on the swagger UI.
Note: Model ledger is timer-based and you can configure the timer as per your requirement. The default value is two minutes. You can set the timer by updating ledgerUpdaterDelayInMillis property value under "Fixed delay for running ledger updator" configuration in the ConfigValues_OPES.xml file.
Note: The maximum expiry period value for the cache is 2147483647 (Max integer value) and the cache expires after this time duration.


Model loading process change

OPE models are segregated into individual OPE models and are distributed among the catalog services when there are multiple instances of catalog services. In this way, the load is balanced across the services.

In case of any exceptions during the model loading, the failed models are sent to a dead queue.

Note: This process is available for the product, price, and discount models.