Table of Contents

Test-Stress

Test-stress cmdlet 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 Manager "statistics" or regular PerfMon.

Test-Stress for ASP.NET Sessions

A test case represents a user session or multiple get and update operations on the same cache key. Use 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 (ASP.NET session simulation would use 1 get and 1 update) and 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] [-DataSize] [-GetsPerIteration] [-ItemsCount] [-NoLogo] [-Password] [-ReportingInterval] [-SlidingExpiration] [-TestCaseIterationDelay] [-TestCaseIterations] [-ThreadCount] [-UpdatesPerIteration] [-UserId]

These properties are explained in detail in the Properties section.

Examples

  • This command executes Test-stress on a Cache named demoCache with default settings.
Test-Stress -CacheName demoCache
  • This command executes Test-Stress on demoCache and then sets the size of each cache item as 2 kilobytes 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

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. -
-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 item count gets displayed. 5000
UserId <String> Specifies the User Id used to authorize a user if security is enabled on cache server. This User Id must be the same as the active directory user credentials.
NOTE: This option is only available in Enterprise edition.
-
-Password <String> Specifies the password against the user Id; to authorize a user if security is enabled on cache server. This password must be the same as active directory password.
NOTE: This option is only available in Enterprise edition.
-
-NoLogo <SwitchParameter> Suppresses display of the logo banner. False