Test Cluster Through Stress
NCache provides the Test-Stress tool to simulate heavy transactional workloads against a running cache. Use it to evaluate cache performance, scalability, latency, and throughput under load. You can run Test-Stress through the NCache Management Center or through PowerShell. It adds and expires test data, allowing real-time monitoring of key metrics like Additions/sec, Fetches/sec, Gets/sec, and expirations through NCache Monitor, Statistics view, or PerfMon.
Note
You can simulate the usage of different store types and monitor Cache Counters for your cache by following the same steps listed below.
Note
Test-Stress behavior varies by in-memory store type:
- Distributed Cache: Normal cache data is inserted and fetched from the cache.
- Pub/Sub Messaging Cache: Topics, publishers, and subscribers are created, along with message data.
Using the NCache Management Center
Follow the steps mentioned below to simulate your cache usage under stress through the NCache Management Center:
Launch the NCache Management Center by browsing to http://localhost:9801 or
<server-ip>:9801.From the left navigation bar, click on Clustered Caches.

Create a new cache or select the cache you want to simulate.
Make sure that the cache is started.
You can run and monitor Test-Stress in either of the following ways:
Option 1: Run Test-Stress from the Toolbar
Select the cache you want to simulate.
On the toolbar, click on the Test-Stress button, which opens up a dialog box containing various time options.

From the options list, you can select how much time you want Test-Stress to run. The options are:
- 10 seconds
- 30 seconds
- 1 minute
- 3 minutes
- 5 minutes
Click Start to begin the stress test.
You can then open Monitor or Statistics to observe the cache counters while the test is running.
Option 2: Open Monitor or Statistics from the Cache Menu
- Select the cache you want to simulate and click on the "..." button against it. This opens a dropdown menu of various operations that you can perform on the cluster.
From these options, select Monitor Cluster if you want to visually see the counters updating, or select Show Statistics if you want to view the statistics of the selected cache.
After the Monitor or Statistics view opens, click the Test-Stress button.
Select the Test-Stress duration:
- 10 seconds
- 30 seconds
- 1 minute
- 3 minutes
- 5 minutes
Click Start to begin the stress test.
During the selected duration, test data is added to your cache. After the specific expiration interval has elapsed, the data is removed from the cache.
The following sections explain both monitoring views.
View Simulation Through NCache Monitor
The NCache Monitor provides a graphical view dashboard to monitor various cache counters. If you choose to view cache usage simulation through the NCache Monitor, follow these steps:
- After clicking on the Monitor button, click on the Test-Stress button.
From the dropdown, you can choose the Test-Stress Timer for 10 or 30 seconds or 1, 3, or 5 minutes, depending on your choice.
As soon as you press the Start button, you can visualize the various cache operations on the monitoring dashboard.
You can view the data being added to the cache through the counters displayed on the NCache Monitor. After the set expiration interval has elapsed, the counters will show data being removed from the cache.

View Simulation Through NCache Statistics
NCache Statistics provides a report view of Cache Counters. If you choose to simulate cache usage through statistics, then follow these steps:
- On the statistics board, click on the Test-Stress button. This opens up a dialog box through which you can customize your simulation.

In the dialog box, you can choose the Test-Stress Timer for 10 or 30 seconds or 1, 3, or 5 minutes, depending on your choice.
As soon as you press the Start button, you can view the statistics for different operations on the cache, like Additions/sec and Fetches/sec.
You can view the data being added to the cache through the counters shown on the screen. After the set expiration interval has elapsed, the counters will show the data being removed from the cache.

Using PowerShell
You can also simulate cache usage under stress through the Test-Stress PowerShell cmdlet.
- This command executes Test-Stress on a Cache named defaultCache with default settings.
Test-Stress -CacheName defaultCache
- This command executes Test-Stress on defaultCache and then sets the size of each cache item as 2KB keeping the rest of the settings as default.
Test-Stress -CacheName defaultCache -DataSize 2048
- This command executes the Test-Stress on the defaultCache and adds items of size 2 KB through the specified load-balanced server, 20.200.20.11.
Test-Stress -CacheName defaultCache -DataSize 2048 -LoadBalancerEnabled -Server 20.200.20.11
- This command executes Test-Stress on defaultCache and will add items of size 2KB.
Test-Stress -CacheName defaultCache -DataSize 2048 -Server "20.200.20.11,20.200.20.10"
- This command executes Test-Stress on defaultCache and sets the Reporting interval as 2000, the thread count as 3 (which is the maximum value for thread count), Get operations to be performed per iteration as 3, iterations within a test-case as 18, interval for sliding expiration as 10 seconds and number of updates performed per iteration as 2; keeping the rest of the settings as default.
Test-Stress -CacheName defaultCache -ReportingInterval 2000 `
-ThreadCount 3 -GetsPerIteration 3 `
-TestcaseIterations 18 -TestCaseIterationDelay 0 `
-SlidingExpiration 10 -UpdatesPerIteration 2
- This command executes the Test-Stress on the demoCache and adds items of size 2 KB using the specified server, David Watson.
Test-Stress -CacheName demoCache -DataSize 2048 -Server David-Watson
- This command runs a stress test on defaultCache using items of size 2 KB and the specified servers with mutual TLS (mTLS) enabled. It runs from a machine where NCache is not installed and uses
C:\certs\client.pemto authenticate the machine running the cmdlet. The-TlsCertPasswordparameter decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
Test-Stress -CacheName defaultCache -DataSize 2048 `
-Server "20.200.20.11,20.200.20.12" -TlsCertPath "C:\certs\client.pem" `
-TlsCertPassword "clientKeyPassword"
- This command executes Test-Stress on a Cache named defaultCache with default settings, using security credentials.
Test-Stress -CacheName defaultCache -Credentials(Get-Credential john_smith)
See Also
NCache Counters
Monitor Caches using NCache Management Center
Monitor NCache using Windows PerfMon