Test Client-Server Connectivity Through Stress
NCache provides the Test-Stress tool to verify client-server connectivity by simulating cache operations against a running cache. Run Test-Stress via NCache Management Center or from a client machine through PowerShell to confirm connectivity and successful cache operations. Monitor counters such as Requests/sec, Additions/sec, Fetches/sec, Gets/sec, and expirations using NCache Monitor, Statistics view, or PerfMon during the test.
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.
Prerequisites
- The cache is created and started.
- The client node is added to the cache configuration.
- The client machine can reach the cache servers over the required ports.
- The client has the required NCache client installation and configuration.
- If security is enabled, valid cache credentials are available.
Using the NCache Management Center
Follow the steps mentioned below to verify client-server connectivity 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 for which you want to verify client-server connectivity.
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 for which you want to verify client-server connectivity.
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 for which you want to verify client-server connectivity 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.
Once inside either view, follow the steps in the sections below to run Test-Stress and observe counters.
View Client Activity Through NCache Monitor
The NCache Monitor provides a graphical dashboard to monitor various cache counters. If Test-Stress is running successfully, the client dashboard and cache counters show active operations. If you choose to view client activity 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 that take place on the client dashboard.
During the selected duration, Test-Stress performs cache operations through the client connection. You can view data being added to the cache via the counters displayed in the NCache Monitor. After the set expiration interval has elapsed, the counters will show data being removed from the cache.

If the counters update, the client is successfully connected to the cache servers and is performing cache operations.
View Client-Server Operations Through NCache Statistics
NCache Statistics provides a report view of Cache Counters. You can use it to confirm that requests from the client are reaching the cache.
- 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.

If these counters update, the client-server connection is active, and cache operations are being processed.
Using PowerShell
You can also verify client-server connectivity by running Test-Stress from the client machine using the Test-Stress 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
Test-Stress PowerShell Reference
Add Client Nodes
Remove Client Nodes