Update Cache Config
NCache supports changes in cache configuration. However configuration changes of a running cache are not effective unless you restart the cache instance.
Note
You can update a cache configuration without stopping any other cache. They can continue running without any interruptions. Even restarting NCache Service process does not stop any of the cache processes. The only cache you need to stop is the one you’re modifying.
Step 1: Stop Cache on All Nodes
Stop the (running) cache on all servers in case of clustered cache and local server in case of local cache. Stop the cache through PowerShell using the following command. For more detail please see the Stop-Cache section.
Stop-Cache <cache-name>
Important
Repeat this step on all cache server nodes in case of partitioned and replicated cache.
Step 2: Modify config.ncconf on All Nodes
For Replicated and Partitioned Cache, cache configuration on all server nodes must be identical. So if you want to increase cache size from 1GB to 2GB, then this change should be reflected in the cache configuration of all cache server nodes. If cache configuration is not identical, your cache may behave unpredictably. Modify the configurations in config.ncconf according to your own settings.
For example, if you want to modify the cache size, update the config.ncconf of all server machines in case of clustered cache and local server machine in case of local cache.
Specify the <cache-size>
by specifying the <storage>
tag under the <cache-settings>
tag.
<cache-config>
<cache-settings ...>
...
<storage type="heap" cache-size="1024mb"/>
...
</cache-settings>
</cache-config>
For more detail on updating the cache settings please see the Configure Cache Settings section.
Step 3: Restart NCache Service on All Nodes
For the configuration changes made to take effect, restart NCache Service:
Restart Service in Windows
Make sure you have enough privileges to restart the service. If the user is not the part of the Administrator's group, make sure to run PowerShell as administrator, otherwise you might get an error message that "Cannot open ncachesvc service on computer".
Execute the following command in PowerShell to restart NCache Service:
Restart-Service -Name NCacheSvc
Restart Service in Linux
In a terminal of your choice, execute the following command:
> sudo systemctl restart ncached
Important
Repeat this step on all cache server nodes in case of partitioned and replicated cache.
Step 4: Start Cache on All Nodes
Once the configurations have been updated, start the cache on each server through PowerShell using the Start-Cache cmdlet.
Start-Cache -Name <cache-name>
Important
Repeat this step on all cache server nodes in case of partitioned and replicated cache.