ePOS Performance | Offline sync service utilizing 100% CPU usage
Hi Guys, You might have viewed my last blog on ePOS | Retail Implementation using SQL Express which will help you in reducing the Database size when dealing with SQL Express. In this blog I would like to explain further on the performance issues that occurs even after reducing the Database size. One of them is “Offline sync service utilizing 100% CPU usage”.
As I earlier said, Retail implementation becomes challenging, when you enable offline mode.
Before we move forward lets understand the background of the Offline mode.
Microsoft has implemented the Sync Services for ADO.NET model that provides a “tracking” table for every table (used to figure out what changes have occurred) that is used for Offline sync.
The Offline profile drives the synchronization between Online and Offline Database.
Synchronization frequency and direction
Here you can configure the sync frequency for each table or table groups. Synchronization direction sets the table or table group to sync in particular direction such as –
- Upload – This sync the data from Offline to Online Database and mostly used for Transaction data.
- Download – This sync the data from Online to Offline Database and mostly used for Setups and Master data.
- Bidirectional – This sync the data from Online to Offline and Offline to Online Database. This is mostly used for the data where POS wants access the data created in Online into Offline and vice versa. The best example of the shift data (RetailShiftStagingTable).
The configuration of Synchronization frequency and direction is not simple as it looks but it involves careful planning and analysis of the various factors.
When you configure the sync frequency to a very low value lets say 10 seconds (for transaction data), the sync is similar to continuous and could load up the CPU. You will have to analyze the amount of data that will be syncing within that interval and then decide the frequency. For instance, for POS transactions, you can setup the frequency to 5 minutes as it is going to sync only when the POS becomes Online and this is the only data for sync because the transactions are now creating directly in Online Database. In case of Master data, set the frequency to somewhere between 15 to 45 minutes depending on how frequently changes are pushed down to POS from AX. Doing these changes in the synchronization frequency will lower the burden on Offline sync.
The connectivity between the Online and Offline Database is very important and you should keep in mind that the connection should always be uninterrupted. Connectivity failure will result in sync errors and may result in important data not synced in Online Database. As per the Offline model the sync happens continuously as per the frequency but if the connection is lost, the Offline sync still tries to connect and gives the same error again and again, thereby increasing the size of the log file.
Performance issues @ ePOS
Now as we have understood the background of Offline sync lets come back to the topic and understand how it can cause performance issues at POS. As we have seen how synchronization frequency impact the Offline sync, it also has adverse effect when you configure the frequency too low which make the sync near to real time. This will make CPU utilization to reach 100% and will freeze POS during the time Offline sync is happening. You can avoid these performance issues caused due to Offline sync by taking below actions –
The simplest way is to reduce the synchronization frequency by carefully analyzing the impact and importance of sync time (the data required to be available at the destination database).
The Offline sync is designed to sync multiple tables in parallel thereby takes less time to update the Destination Database. Set the “SyncInParallel” node value to “False”. Setting this false will make the Offline sync to push data sequentially. This might take time to sync the data to the Destination Database. But this will definitely lower down your CPU utilization to 5-20%. You can access the Offline config file from “C:\Program Files (x86)\Microsoft Dynamics AX\60\Retail POS\RetailOffline\Microsoft.Dynamics.Retail.Offline.Service.exe.config“
Another reason for 100% CPU utilization is the writing of logs for each and every transaction that being tracked by the Offline sync. You can either disable the logs or only capture the errors. My suggestion would be to disable the logs because in case of sync error, you can enable it back and see the error message. Enabling the logs keeps on writing the same error message again and again thus loading the CPU. You can disable the logs from in the same config file. Set the value as 0 to disable the Offline sync trace logs.
Every time you update the Offline config file, make sure you restart the Offline service. Hope this blog will help you troubleshoot the POS performance issues caused by Offline mode.
Feel free to reach out for any clarifications. If you like my blog posts then comment and subscribe to the blogs.
Disclaimer: The information in the weblog is provided “AS IS”; with no warranties, and confers no rights. All blog entries and editorial comments are the opinions of the author.