Test Stress
This simulates heavy transactional load on a specified cache, to monitor NCache performance under stress in a given environment. Please monitor NCache performance counters in NCache Management Center "statistics" or regular PerfMon.
Test-Stress for Sessions
A test case represents a user session or multiple get and update operations on
the same cache key. Use a test case to simulate ASP.NET or JSP sessions. When all
TestCaseIterations
are used up, a user session becomes idle and is left to
expire. Each TestCaseIteration consists of one or more Gets and Updates a (ASP.NET
session simulation would use 1 get and 1 update) and the TestCaseIterationDelay
represents a delay between each iteration and can be used to simulate ASP.NET
session behavior where a user clicks on a URL after 15-30 seconds delay.
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.
Distributed Lucene with Persistence: Distributed Lucene documents will be created, read, and searched.
Examples
- This command executes Test-stress on a Cache named demoCache with default settings.
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
- The following commands 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 demoCache -ReportingInterval 2000 -ThreadCount 3 -GetsPerIteration 3 -TestcaseIterations 18 -SlidingExpiration 10 –UpdatesPerIteration 2
- This command executes stresstesttool 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. This is not used in case of DistributedLucene store type. |
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. (Default: 5000 docs for Lucene, infinite for all other store types.) | 0 |
-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. This is not used in case of Distributed Lucene | 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 who has appropriate permissions at the node. | - |