Monitor Caches in PowerShell
Both local and clustered caches publish performance statistics. In this step, you will verify that the Stress test tool that you ran in previous step is making cache calls successfully.
NCache provides a set of PowerShell cmdlets to support monitoring of cache health and performance statistics.
Make sure NCache Service is started. If it is not started, type the following command in a terminal:
> sudo systemctl start ncached
Monitor Cache Server Statistics
Get-CacheServerStatistics cmdlet displays a list of performance counters for the specified cache. This shows default counters but can be extended by a list of custom counters.
You can also save these counters to a .CSV file to view them later, i.e. in Excel. This .CSV file can also be converted to a .BLG file which can be viewed in Performance Monitor in a Windows environment.
- The following command displays the default counters for the cache demoClusteredCache continuously after every default sample interval.
Get-CacheServerStatistics -CacheName demoClusteredCache -Continuous
- The following command saves the counters for demoClusteredCache in CSV format at the specified path.
Get-CacheServerStatistics -CacheName demoClusteredCache -Format csv | Out-File -Encoding ascii "<your-location>\test.csv"
For more options on using this tool, refer to this PowerShell Reference.
Monitor Cluster Health
Get-ClusterHealth cmdlet lists all nodes registered on cache specified. It displays:
- Status of the cache (Running/Stopped)
- Number of connected clients
This example displays the nodes of the cache, status, connection and number of connected clients for demoClusteredCache.
Get-ClusterHealth -CacheName demoClusteredCache
For more detail on using this tool, refer to this PowerShell Reference.