This blog promotes knowledge sharing through experience and collaboration. For more product information, visit our WebSphere Commerce CSE page. For easier navigation, utilize the Categories to find posts that match your interest.
Understand and Improve di-calculateprice
The di-calculateprice utility is used to update the information in the price index based on the pricing model your store uses. It is very important to understand the flow of the utility, and the factors that can impact the utility’s performance. This blog post will give general description of the flow that the utility takes, and best practices tips to improve the performance of the utility.
Before I describe the general flow of the utility, I want to clear a common misunderstanding of one of the parameters that can be passed to the utility. The parameter I am talking about is numWorkers. Many clients think that this parameter corresponds to the number of worker threads that are being used by the utility. However, this is not the case. This parameter is for determining the load that each worker thread receives. The larger this number is, the more work that each worker thread will be performing. Let's say you have a million catentries and numWorkers set to 1000. This will result in every calculating thread performing calculations for 1,000 (1,000,000/1000) catentries. However, the number of threads that will be performing the work itself is based on your WorkManager configuration in WAS for the Commerce JVM. By default, you will have 10 threads in this pool. You can check your configurations in WAS for the Commerce server to see what it's set to.
Note that the more WorkManager threads that are available, the more work that can be completed, at the expense of CPU utilization.
Now that we cleared this possible misunderstanding, let me describe the general flow of the utility. The utility will call ContractPriceCalculate command, which is implemented through ContractPriceCalculateCmdImpl.ContractPriceCalculateCmdImpl performs following high level tasks: