Reduce Log size on Service Fabric node

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

 

Replicator log size :

This is the shared transaction log that gets created to back any reliable collections for stateful services.

SharedLogSizeInMB specifies the number of MB of disk space to statically pre-allocate for the default shared log on all nodes. The value must be 2048 or larger. You can find these files under - D:\SvcFab\ReplicatorLog

 

Ref. https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-actors-reliabledictionarystateprovider-configuration#configuration-names

 

The global reliable service configuration is specified in the cluster manifest for the cluster under the KtlLogger section. It allows configuration of the shared log location and size plus the global memory limits used by the logger.

 

You can alter this by changing the setting as below –

 

  1. Go to https://resources.azure.com
  2. Navigate to your subscription by expanding subscriptions-> <Your Subscription> -> resourceGroups -> <Your Resource Group> -> providers -> ServiceFabric -> clusters -> <Your Cluster Name>
  3. In the top right corner, select Read/Write.
  4. Select Edit and update the fabricSettings JSON element and add a new element:

         "fabricSettings": [

          {

          "name": "KtlLogger",  

           "parameters": [

            { 

            "name": "SharedLogSizeInMB",

             "value": "4096"    

             }

              ]

              } ] 

 

More details can be found here - https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-config-upgrade-azure 

 

Once you make these changes, if we scale out the NodeType, then the new nodes will have the latest setting and the replicator log will be of 4 GB.

 

clipboard_image_0.jpeg

However, for the existing nodes, the log size will not change from 8 GB. To get the size to 4 GB, please follow the below steps.

 

  1. Disable the node with Intent to remove data - https://docs.microsoft.com/en-us/powershell/module/servicefabric/disable-servicefabricnode?view=azureservicefabricps

         Disable-ServiceFabricNode -NodeName _FE_1 -Intent RemoveData 

    2. Go to the Path - D:\SvcFab\ReplicatorLog & delete the file

    3. Activate the node and the ReplicatorLog file will be created with the updated size - https://docs.microsoft.com/en-us/powershell/module/servicefabric/enable-servicefabricnode?view=azureservicefabricps

 

Windows Fabric Log files :

 

You can also configure the Diagnostics setting for MaxDiskQuotaInMB which controls Disk quota in MB for Windows Fabric log files.

You can find these traces under D:/SVCFab/Log/Traces folder.

 

Details can be found here - https://github.com/Azure/Service-Fabric-Troubleshooting-Guides/blob/master/Cluster/dataDisk%20(D)%20out%20of%20disk%20space.md#question-1

 

The log size setting is defined via MaxDiskQuotaInMB, and can be changed by editing/ adding the fabricSettings JSON element as below :

 

  {

   "name": "Diagnostics"

    "parameters": [  

      {

       "name": "MaxDiskQuotaInMB"

       "value": "65536"

         }

       ] 

    }

 

More details on various fabric settings for your Service Fabric cluster that you can customize can be found here: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-fabric-settings

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.