Test-Stress - Monitor Cache Performance
This PowerShell Cmdlet simulates heavy transactional load on a specified cache, to monitor cache performance under stress in a given environment. Please monitor cache performance counters in NCache Management Center Statistics or regular PerfMon. A test case represents a user session with multiple get and update operations on the same cache key, simulating behaviors like ASP.NET or JSP sessions. Each iteration consists of one or more gets and updates, followed by a TestCaseIterationDelay
(e.g., 15–30 seconds) to mimic user interactions. When all TestCaseIterations
are completed, the session becomes idle and expires.
Important
NCache OSS has different parameters in some Cmdlet instances.
Test-Stress [-CacheName] [-Server] [-DataSize] [-GetsPerIteration] [-ItemsCount] [-ReportingInterval] [-SlidingExpiration] [-TestCaseIterationDelay] [-TestCaseIterations] [-ThreadCount] [-UpdatesPerIteration] [-Credentials] [-NoLogo]
Behavior for Different In-Memory Store Types
The execution of the Test-Stress
cmdlet varies with your InMemoryStoreType
.
Distributed Cache: Normal cache data will be inserted and fetched from the cache.
Distributed Cache with Persistence: Data will be inserted and fetched from the persistence store.
Pub/Sub Messaging Cache: Topics, Publishers, and Subscribers will be created. Message data will also be generated.
Examples of Test-Stress - Monitor Cache Performance
- This command executes Test-stress on a Cache named demoCache with default settings to monitor cache performance.
Test-Stress -CacheName demoCache
- This command executes Test-stress on cache named demoCache on Server 20.200.20.11 with default settings.
Test-Stress -CacheName demoCache -Server 20.200.20.11
- This command executes Test-Stress on demoCache and then sets the size of each cache item as 2KB keeping the rest of the settings as default.
Test-Stress -CacheName demoCache -DataSize 2048
- This command executes Test-Stress on demoCache and sets the,Reporting interval as 2000, the thread count as 3 (which is the maximum value for thread count), Gets 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 demoCache -ReportingInterval 2000 -ThreadCount 3 -GetsPerIteration 3 -TestcaseIterations 18 -SlidingExpiration 10 –UpdatesPerIteration 2
- This command executes Test-Stress on demoCache and will add items of size 2KB. This command ignores deployment details specified in client.ncconf.
Test-Stress -CacheName demoCache -DataSize 2048 -Server "20.200.20.11,20.200.20.10"
Properties
Note
The parameters with asterisk (*) on their names are the required parameters and the rest are optional.
Parameters | Data Types | Description | Default Value |
---|---|---|---|
-CacheName* |
<String> |
Specifies the name of the cache. | - |
-Server |
<String> |
Specifies one or more ip-address(es) for one or more cache-server(s). This option can be used to customize the list of ip-address(es) to be displayed. Note: Comma separated ip-addresses are to be specified in case of multiple servers inside double quotes. |
- |
-DataSize |
<Integer> |
Specifies the size of each cache item in bytes. | 1024 |
-GetsPerIteration |
<Integer> |
Specifies the number of ‘gets’ within one iteration of a test-case. This is only used in case of DistributedCache or DistributedCacheWthpersistence store type. |
1 |
-ItemsCount |
<Integer> |
Specifies how many total items, docs or messages you want to add. | Infinite for all store types. |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | |
-ReportingInterval |
<Integer> |
Specifies the interval after which the item count gets displayed. | 5000 for DistributedCache , 50000 for PubSubMessaging cache store types. |
-SlidingExpiration |
<Integer> |
Specifies in seconds sliding expiration or each item or message. | 300 for DistributedCacheWithPersistence , and 60 for DistributedCache and PubSubMessaging store types. |
-TestCaseIterations |
<Integer> |
Specifies the total number of iterations within a test-case. | 20 |
-TestCaseIterationDelay |
<Integer> |
Specifies the delay (in seconds) which can be held in between each iteration. | 0 |
-ThreadCount |
<Integer> |
Specifies the total number of Client threads. Its maximum value is 3. | 1 |
-UpdatesPerIteration |
<Integer> |
Specifies the number of updates performed within a single iteration of a test-case. This is only used in case of DistributedCache . |
1 |
-Credentials |
<pscredential> |
Specifies the user credentials required to authorize access for the specified operation. These credentials should belong to a user with the appropriate permissions at the node. | - |