Configure Write-Through Providers for Write-Behind Operations
If write-behind option is enabled, then all of the data source operations are queued up and performed in the background. There are multiple settings, which can be used to optimize the write-through provider to fulfill the user requirements.
Using NCache Manager
Click on the cache name in Cache Explorer in NCache manager. Cache settings open in right side pane in NCache Manager.
Go to the Backing Source tab.
Configure a write-through provider as explained in Configuring Write Through Provider.
Once here, you can change or specify the values as per your application requirement(s).
Check the Enable Batching checkbox to perform all write-behind operations on data source in bulk/batches. You can also configure the Batch-interval(s) and Operation-delay(ms) for the batching mode.
Change the value for Operations per second, to control how many write-behind operations will be performed on data source in a second.
You can also configure the Failed operations queue limit. This queue is used to re-queue the failed operations and will be retried on the data source.
Failed operations eviction ratio specifies the eviction ratio percentage to evict the most retried operations when queue is full.
Once you have added the Read-Through/Write-Through providers, deploy the providers through Deploy Backing Source Providers which requires the assemblies to be deployed over NCache.
Right click on the cache name in Cache Explorer and select the Apply Configuration option.
Using Command Line Tool
- Open Command Prompt.
- Go to the NCache tools directory:
addbackingsource.exe, provide following information:
addbackingsource.exe demoLocalCache /path C:\Providers.dll /c NCache.Sample.Providers.Writers.Writer1 /pn writer1 /W /b true /ops 500
This will configure Writer1 as write-through provider on demoLocalCache with write-behind enabled and with throttling limit of 500 operations per second.
Deploy required assemblies using
deployprovider.exe. Use the following command on Command Prompt:
deployprovider demoCache/T C:\Providers.dll
- This will deploy all assemblies from the given path to NCache.