Test-Stress Cache
You can generate heavy transactional load on a specified cache in order to monitor NCache performance under stress in a given environment using Test-Stress.
Using NCache Web Manager
Launch NCache Web Manager by browsing to
http://localhost:8251
(Windows) or<server-ip>:8251
(Windows + Linux).In the left navigation bar, click on Clustered Caches. This opens up the Clustered Caches page at
<server-ip>:8251/ClusteredCaches/
.
Select your cache and click on .
Once the Test-Stress button is clicked, you will be prompted with a drop down menu where you will have to specify the time for Test-Stress. After selecting the time, click on the start button.
- Once Test-Stress has started, click on from the toolbar. This will lead you to the statistics page where you will be able to monitor your cache under stress by observing the cache counters.
Using PowerShell
You can also perform a stress test on your cache using the PowerShell. This is done using the Test-Stress* cmdlet. The command along with its parameters is shown below.
Test-Stress [-CacheName] [-Server] [-DataSize] [-GetsPerIteration] [-ItemsCount] [-NoLogo] [-ReportingInterval] [-SlidingExpiration] [-TestCaseIterationDelay] [-TestCaseIterations] [-ThreadCount] [-UpdatesPerIteration]
The parameters along with their descriptions are explained below.
Examples
- This command executes
Test-stress
on a cache named demoClusteredCache with default settings.
Test-Stress -CacheName demoClusteredCache
- This command executes Test-stress on cache named demoClusteredCache on Server 20.200.20.38 with default settings.
Test-Stress -CacheName demoClusteredCache -Server 20.200.20.38
- This command executes
Test-Stress
on demoClusteredCache by adding cache items of 2 KB, keeping the rest of the settings as default.
Test-Stress -CacheName demoClusteredCache -DataSize 2048
- The following commands executes
Test-Stress
on demoClusteredCache and sets the Reporting interval as 2000, thread count as 3 (which is the maximum value for thread count), Gets per iteration as 3, iterations within a test-case as 18, interval for sliding expiration as 10 seconds and updates performed per iteration as 2; keeping the rest of the settings as default.
Test-Stress demoClusteredCache -ReportingInterval 2000 -ThreadCount 3 -GetsPerIteration 3 -TestcaseIterations 18 -SlidingExpiration 10 –UpdatesPerIteration 2
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. | - |
-ItemsCount |
<Integer> |
Specifies the total number of items you want to add. | Infinite |
-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 (Zero) |
-GetsPerIteration |
<Integer> |
Specifies the number of ‘gets’ within one iteration of a test-case. | 1 |
-UpdatesPerIteration |
<Integer> |
Specifies the number of updates performed within a single iteration of a test-case. | 1 |
-DataSize |
<Integer> |
Specifies the size of each cache item in bytes. | 1024 |
-SlidingExpiration |
<Integer> |
Specifies the time interval for Sliding Expiration in seconds. Its minimum value is 15 seconds. | 300 |
-ThreadCount |
<Integer> |
Specifies the total number of Client threads. Its maximum value is 3. | 1 |
-ReportingInterval |
<Integer> |
Specifies the interval after which the cache count gets displayed. | 5000 |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |