From 6ac7e7b19a04471edbcc45f7c1ce5cc356aa9d33 Mon Sep 17 00:00:00 2001 From: Heitor Tashiro Sergent Date: Tue, 13 Feb 2024 18:15:20 -0300 Subject: [PATCH] chore: add redirect from stress testing to grafana page (#1507) * chore: add redirect from stress testing to grafana page * add redirect to front matter * Update 03 Stress testing.md * Delete 03 Stress testing.md * Create 03 Stress Testing.md --- gatsby-node.js | 6 + .../en/06 Test Types/03 Stress Testing.md | 4 + .../en/06 Test Types/03 Stress testing.md | 108 ------------------ 3 files changed, 10 insertions(+), 108 deletions(-) create mode 100644 src/data/markdown/translated-guides/en/06 Test Types/03 Stress Testing.md delete mode 100644 src/data/markdown/translated-guides/en/06 Test Types/03 Stress testing.md diff --git a/gatsby-node.js b/gatsby-node.js index 5137895b9e..51c5590922 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1368,6 +1368,12 @@ const createRedirects = ({ actions }) => { isPermanent: true, }); + createRedirect({ + fromPath: '/test-types/stress-testing/', + toPath: 'https://grafana.com/blog/2024/01/30/stress-testing/', + isPermanent: true, + }); + createRedirect({ fromPath: '/cloud/cloud-faq/release-notes/', toPath: '/cloud/cloud-reference/release-notes/', diff --git a/src/data/markdown/translated-guides/en/06 Test Types/03 Stress Testing.md b/src/data/markdown/translated-guides/en/06 Test Types/03 Stress Testing.md new file mode 100644 index 0000000000..5a52eb141a --- /dev/null +++ b/src/data/markdown/translated-guides/en/06 Test Types/03 Stress Testing.md @@ -0,0 +1,4 @@ +--- +title: 'Stress testing' +redirect: 'https://grafana.com/blog/2024/01/30/stress-testing/' +--- \ No newline at end of file diff --git a/src/data/markdown/translated-guides/en/06 Test Types/03 Stress testing.md b/src/data/markdown/translated-guides/en/06 Test Types/03 Stress testing.md deleted file mode 100644 index f0203acef9..0000000000 --- a/src/data/markdown/translated-guides/en/06 Test Types/03 Stress testing.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: 'Stress testing' -head_title: 'What is Stress Testing? How to create a Stress Test in k6' -excerpt: 'Stress tests assess the limits of your system and stability under extreme conditions.' -canonicalUrl: https://grafana.com/blog/2024/01/30/stress-testing/ ---- - -Stress testing assesses how the system performs when loads are heavier than usual. - -The load pattern of a stress test resembles that of an average-load test. The main difference is higher load. -To account for higher load, the ramp-up period takes longer in proportion to the load increase. -Similarly, after the test reaches the desired load, it might last for slightly longer than it would in the average-load test. - -![Overview of a stress test](images/chart-stress-test-overview.png) - -In some testing conversation, stress tests might also be called rush-hour, surge, or scale tests. - -## When to perform a Stress test - -Stress tests verify the stability and reliability of the system under conditions of heavy use. -Systems may receive higher than usual workloads on unusual moments such as process deadlines, paydays, rush hours, ends of the workweek, and many other behaviors that might cause frequent higher-than-average traffic. - -## Considerations - -When you run a stress test, consider the following: - -* **Load should be higher than what the system experiences on average.** - - Some testers might have default targets for stress tests—say an increase upon average load by 50 or 100 percent—there's no fixed percentage. - - The load simulated in a Stress test depends on the stressful situations that the system may be subject to. Sometimes this may be just a few percentage points above that average. Other times, it can be 50 to 100% higher, as mentioned. Some stressful situations can be twice, triple, or even orders of magnitude higher. - - Define load according to the risk load patterns that the system may receive. - -- **Only run stress tests after running average-load tests.** - - Identify performance issues under average-load tests before trying anything more challenging. - This sequence is essential. - -* **Re-use the Average-Load test script.** - - Modify the parameters to have higher load or VUs. - -* **Expect worse performance compared to average load.** - - This test determines how much the performance degrades with the extra load and whether the system survives it. A well-performant system should respond with consistent response times when handling a constant workload for an extended period. - - -## Stress testing in k6 - -The load in a stress test resembles load in an average-load test. -The difference is that it reaches a higher level of load. -1. Increase the script's activity further in a slower ramp-up until it reaches an above-average number of users or throughput. -1. Maintain that load for a while. -1. Depending on the test case, stop or ramp down gradually. - - - -```javascript -import http from 'k6/http'; -import {sleep} from 'k6'; - -export const options = { - // Key configurations for Stress in this section - stages: [ - { duration: '10m', target: 200 }, // traffic ramp-up from 1 to a higher 200 users over 10 minutes. - { duration: '30m', target: 200 }, // stay at higher 200 users for 30 minutes - { duration: '5m', target: 0 }, // ramp-down to 0 users - ], -}; - -export default () => { - const urlRes = http.get('https://test-api.k6.io'); - sleep(1); - // MORE STEPS - // Here you can have more steps or complex script - // Step1 - // Step2 - // etc. -}; - -``` - - - -For more complex behavior, refer to [Examples](/examples). - -The VU or throughput chart of a Stress test looks similar to this: - -![The shape of the stress test as configured in the preceding script](images/chart-stress-test-k6-script-example.png) - - -Note that in the same way as the average-load test, the Stress test starts at 0 and increases beyond the point tested in the average-load type. The ramp-up and ramp-down periods are longer to allow a more realistic response. - -
- -Run stress tests only after smoke and average-load tests. Running this test type earlier may be wasteful and make it hard to pinpoint problems if they appear at low volumes or at loads under the average utilization. - -
- -## Results analysis - -Like the average-load test, an initial outcome for the Stress test shows up during the ramp-up period to identify response time degradation as the load increases further than the average utilization. Commonly, the performance degrades, and even the system's stability crashes as we push the system further than the average-load test. - -During the full load period, verification is vital if the system's performance and resource consumption stays stable with a higher load. - -Now that you know that your system can handle outstanding load events, the teams generally check if the system performs well over extended periods. -That is, they run a [Soak test](/test-types/soak-testing).