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.
enableProductScoringAndLedger
, enablePriceScoringAndLedger
, and enableDiscountScoringAndLedger
properties value as true
for Product, Price, and Discount models respectively in ConfigValues_Common.xml
file.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.
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.ledgerUpdaterDelayInMillis
property value under "Fixed delay for running ledger updator" configuration in the ConfigValues_OPES.xml
file.
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.