6.27Stress and Simulation Testing

Created on Aug 17, 2026~7 min read

When developing application systems that face the internet or must withstand concurrent access from many users, performance stress testing and automated interface simulation testing become critical steps before deployment. Using the report metrics obtained from these two types of testing, we can optimize the code before the system goes live and ensure it meets the minimum launch requirements.

Taking the official website of the Furion framework as an example, run a stress test:

cs
var stressTestHarnessResult = await httpRemoteService.StressTestHarnessAsync("https://furion.net/");Console.WriteLine(stressTestHarnessResult.ToString());  // Print the stress test result

Test result overview:

bash
Stress Test Harness Result:        Total Requests:          100            // Total number of requests        Total Time (s):          7.95           // Total time (seconds)        Successful Requests:     100            // Number of successful requests        Failed Requests:         0              // Number of failed requests        QPS:                     12.58          // Queries per second (QPS)        Min RT (ms):             676.38         // Minimum response time (milliseconds)        Max RT (ms):             7,419.72       // Maximum response time (milliseconds)        Avg RT (ms):             3,314.94       // Average response time (milliseconds)        P10 RT (ms):             1,288.82       // P10 response time (milliseconds)        P25 RT (ms):             2,057.10       // P25 response time (milliseconds)        P50 RT (ms):             3,064.56       // P50 response time (milliseconds)        P75 RT (ms):             4,100.03       // P75 response time (milliseconds)        P90 RT (ms):             5,026.08       // P90 response time (milliseconds)        P95 RT (ms):             7,330.71       // P95 response time (milliseconds)        P99 RT (ms):             7,416.20       // P99 response time (milliseconds)        P99.99 RT (ms):          7,419.72       // P99.99 response time (milliseconds)

The stressTestHarnessResult variable is of type StressTestHarnessResult, which contains the following properties and methods:

  • Properties:

    • TotalRequests: Total number of requests (long type).
    • TotalTimeInSeconds: Total time in seconds (double type).
    • SuccessfulRequests: Number of successful requests (long type).
    • FailedRequests: Number of failed requests (long type).
    • QueriesPerSecond: Queries per second (QPS) (double type).
    • MinResponseTime: Minimum response time in milliseconds (double type).
    • MaxResponseTime: Maximum response time in milliseconds (double type).
    • AverageResponseTime: Average response time in milliseconds (double type).
    • Percentile10ResponseTime: P10 response time in milliseconds (double type).
    • Percentile25ResponseTime: P25 response time in milliseconds (double type).
    • Percentile50ResponseTime: P50 response time in milliseconds (double type).
    • Percentile75ResponseTime: P75 response time in milliseconds (double type).
    • Percentile90ResponseTime: P90 response time in milliseconds (double type).
    • Percentile95ResponseTime: P95 response time in milliseconds (double type).
    • Percentile99ResponseTime: P99 response time in milliseconds (double type).
    • Percentile9999ResponseTime: P99.99 response time in milliseconds (double type).
  • Methods:

    • ToString(): Outputs an indented, detailed report string.

By default, the stress test runs 1 round, each containing 100 concurrent requests, with a maximum concurrency of 100. To obtain more accurate test results, adjust these parameters as needed:

cs
var stressTestHarnessResult = await httpRemoteService.SendAsync(HttpRequestBuilder.StressTestHarness("https://furion.net/")    .SetNumberOfRequests(1000)  // Set the number of concurrent requests    .SetNumberOfRounds(5)   // Set the number of stress test rounds    .SetMaxDegreeOfParallelism(500));   // Set the maximum degree of concurrency// In most cases, you only need to set the number of concurrent requestsvar stressTestHarnessResult = await httpRemoteService.StressTestHarnessAsync("https://furion.net/", 500);var stressTestHarnessResult = await httpRemoteService.SendAsync(HttpRequestBuilder.StressTestHarness("https://furion.net/", 500));