Recently one of our clients faced an issue with preformance of inventory recalculation. For this customer snardard MS Inventory Recalculation was taking nearly 24 hours.
Based on the investigation, the following was determined.
A recalculation run has three phases:
- building the item list is normally quick
- calculation itself is efficient
- processes settlement records one at a time
That final step processes settlement records one at a time, not as a bulk operation. The standard Microsoft code (class InventAdjustPost, method updateItem()) opens a query over the settlement records and loops through them individually.
The one-record-at-a-time loop is in standard product code and cannot be changed by configuration. This is the main cause and it needs a Microsoft support case.
Despite the fact that there is a bottleneck in the MS code, there are several options that can be done to improve performance.
One of them is to enable parallel processing for the calculation phase.
When Extra batch helpers is set to 0, it means that the calculation runs on a single thread. The recommendation is to set it to 4–8 and pointing the helper batch group at a group that has a batch server behind it. This is a settings change, not development. It would speed up the calculation phase only roughly a third of the run. It is cheap and safe, but it does not solve the main problem.
Go to Inventory and warehouse management parameters > Inventory accounting tab, Extra batch helpers field.
Second improvement is to clean up the batch framework tables.
Check how many failed batch tasks and failed batch jobs you have, and clean them up. It affects all batch processing, not just inventory recalculation.
No comments:
Post a Comment