Speeding up Web Analytics logging on external storage

   —   
If you run your website in a cloud environment and use external storage such as Azure Blob Storage or Amazon Simple Storage to store file data, you may encounter issues with Web Analytics data processing. To be specific, Web Analytics data may not be processed fast enough, because of the high latency of the before mentioned external storages. As a result, logs with WA data will cumulate at the storage and your WA graphs will remain empty.
Web Analytics module writes logs to the file system and processes it in chunks every minute. This kind of delayed processing causes significant amount of IO operations which can cause troubles on external storage with high latencies. The solution to this problem is to map folder which stores Web Analytics data to the local file system of the web server which is incomparably faster.

To make it work, just add the following line at the application start:
StorageHelper.MapStoragePath("~/App_Data/CMSModules/WebAnalytics", new StorageProvider());

After making the change, Web Analytics logs will be saved on the local file system and performance problems should go away. The drawback of this change is that you can possibly lose logs from up to one minute in case of the server restart, because file system is usually not persistent at cloud environments.
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.