Skip to content

Commit 9eaf8e2

Browse files
author
rhamlett_microsoft
committed
Updates to load testing defaults and updates to documentation.
1 parent 22275e5 commit 9eaf8e2

File tree

7 files changed

+758
-247
lines changed

7 files changed

+758
-247
lines changed

src/PerfProblemSimulator/Controllers/LoadTestController.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public LoadTestController(
137137
* 3. Allows structured parameters in request body
138138
*
139139
* ALTERNATIVE: GET with query parameters
140-
* GET /api/loadtest?workIterations=1000&bufferSizeKb=100
140+
* GET /api/loadtest?workIterations=200&bufferSizeKb=20000
141141
*
142142
* URL PATTERN:
143143
* The [controller] token is replaced with "loadtest" (class name minus "Controller")
@@ -147,11 +147,11 @@ public LoadTestController(
147147
/// <summary>
148148
/// Executes a load test request with configurable resource consumption.
149149
/// </summary>
150-
/// <param name="workIterations">CPU work intensity (ms of spin per cycle = workIterations / 100). Default: 1000.</param>
151-
/// <param name="bufferSizeKb">Memory buffer held for request duration in KB. Default: 100.</param>
150+
/// <param name="workIterations">CPU work intensity (ms of spin per cycle = workIterations / 100). Default: 200.</param>
151+
/// <param name="bufferSizeKb">Memory buffer held for request duration in KB. Default: 20000.</param>
152152
/// <param name="baselineDelayMs">Minimum request duration in ms. Default: 500.</param>
153-
/// <param name="softLimit">Concurrent requests before degradation begins. Default: 5.</param>
154-
/// <param name="degradationFactor">Additional delay (ms) per request over soft limit. Default: 200.</param>
153+
/// <param name="softLimit">Concurrent requests before degradation begins. Default: 25.</param>
154+
/// <param name="degradationFactor">Additional delay (ms) per request over soft limit. Default: 500.</param>
155155
/// <param name="cancellationToken">Cancellation token from the HTTP request pipeline.</param>
156156
/// <returns>Load test result with timing and diagnostic information.</returns>
157157
/// <remarks>
@@ -215,11 +215,11 @@ public LoadTestController(
215215
[ProducesResponseType(typeof(LoadTestResult), StatusCodes.Status200OK)]
216216
[ProducesResponseType(typeof(ErrorResponse), StatusCodes.Status500InternalServerError)]
217217
public async Task<IActionResult> ExecuteLoadTest(
218-
[FromQuery] int workIterations = 1000,
219-
[FromQuery] int bufferSizeKb = 100,
218+
[FromQuery] int workIterations = 200,
219+
[FromQuery] int bufferSizeKb = 20000,
220220
[FromQuery] int baselineDelayMs = 500,
221-
[FromQuery] int softLimit = 5,
222-
[FromQuery] int degradationFactor = 200,
221+
[FromQuery] int softLimit = 25,
222+
[FromQuery] int degradationFactor = 500,
223223
CancellationToken cancellationToken = default)
224224
{
225225
/*

src/PerfProblemSimulator/Models/LoadTestRequest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ public class LoadTestRequest
118118
/// </list>
119119
/// </para>
120120
/// </remarks>
121-
public int WorkIterations { get; set; } = 1000;
121+
public int WorkIterations { get; set; } = 200;
122122

123123
/// <summary>
124124
/// Size of memory buffer to allocate in kilobytes.
125125
/// </summary>
126126
/// <remarks>
127127
/// <para>
128-
/// <strong>DEFAULT: 100 KB</strong>
128+
/// <strong>DEFAULT: 20000 KB (20 MB)</strong>
129129
/// </para>
130130
/// <para>
131131
/// This memory is allocated at the start of request processing and
@@ -136,14 +136,14 @@ public class LoadTestRequest
136136
/// memory allocation occurs and isn't optimized away.
137137
/// </para>
138138
/// </remarks>
139-
public int BufferSizeKb { get; set; } = 100;
139+
public int BufferSizeKb { get; set; } = 20000;
140140

141141
/// <summary>
142142
/// Number of concurrent requests before degradation delays begin.
143143
/// </summary>
144144
/// <remarks>
145145
/// <para>
146-
/// <strong>DEFAULT: 5</strong>
146+
/// <strong>DEFAULT: 25</strong>
147147
/// </para>
148148
/// <para>
149149
/// When concurrent requests exceed this limit, additional delay is
@@ -163,14 +163,14 @@ public class LoadTestRequest
163163
/// </list>
164164
/// </para>
165165
/// </remarks>
166-
public int SoftLimit { get; set; } = 5;
166+
public int SoftLimit { get; set; } = 25;
167167

168168
/// <summary>
169169
/// Milliseconds of delay added per concurrent request over the soft limit.
170170
/// </summary>
171171
/// <remarks>
172172
/// <para>
173-
/// <strong>DEFAULT: 200 ms</strong>
173+
/// <strong>DEFAULT: 500 ms</strong>
174174
/// </para>
175175
/// <para>
176176
/// <strong>DEGRADATION FORMULA:</strong>
@@ -195,7 +195,7 @@ public class LoadTestRequest
195195
/// So: 5 + 1147 = ~1152 concurrent requests to timeout
196196
/// </para>
197197
/// </remarks>
198-
public int DegradationFactor { get; set; } = 200;
198+
public int DegradationFactor { get; set; } = 500;
199199

200200
/// <summary>
201201
/// Minimum blocking delay applied to every request in milliseconds.

0 commit comments

Comments
 (0)