Skip to content

Conversation

@bubafinder
Copy link
Collaborator

Some initial examples for Performance testing are to give a starting overview.
According to feedback, we need to concentrate on antipatterns and solutions.


### Solution

Introduce think time between user actions to simulate real user behavior. This example adds a random delay between 1 to 5 seconds between each request. The bigger the range, the more realistic the simulation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bubafinder what if we want to stretch the system to test it's limits (load test)?
Do you think this is still the right approach, and if not, is it worth adding a disclaimer?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but adding random amount of delay time simulates real user interaction. When we want to stress test, we just increase the number of concurrent users until the service starts degrading. This is what the screenshot illustrates: VU (virtual users) are ramped up and then we monitor infrastructure usage and response time to find out how the system responds to increased load.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are both right. I need to be more precise about where think time / random waits between actions should be used for performance testing. I will rephrase it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbareta yes, but sometimes tests will intentionally avoid doing that to achieve different system behavior - for example, to avoid relying on cache to keep the system going.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MiroDojkic I didn't understand exactly what are you referring to. Can you explain a bit more?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rephrase it in a way that either says something like:

  • Make tests use the system in a desired way, whether through testing maximum stress capacity of the system, or performance under heavy load. As an example, when testing performance under load, we can add delay between requests to make the flow closer to the real user interaction. This influences how system components that affect performance behave under the hood, such as cache.
  • Or add a disclaimer that this can be achieved in different ways and we need to be thoughtful about the desired system behavior such as whether we want to rely on cache or not, to make it close to the use-case we want to test.

Disclaimer 😄 : This is too verbose. I'm sharing my thoughts on it for the directional purpose.


## Antipattern 2: Lack of Data Variation

Using static, hardcoded data for requests can cause caching mechanisms to produce artificially high performance metrics. In this example, the same username is used for every request, which may not represent real-world scenarios.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯

@bubafinder bubafinder changed the title Initial Examples - Performance testing Performance testing - Initial Examples Jan 17, 2025
@@ -0,0 +1,118 @@
# Performance Testing - Examples
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bubafinder bubafinder requested a review from MiroDojkic January 22, 2025 14:54

Not including think time between user actions can lead to unrealistic performance metrics. In this example, the user actions are executed without any delay, which is unrealistic.
Excluding think time between user actions can result in unrealistic performance
metrics for certain types of tests, such as average, stress, and soak tests.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see this in the glossary. Just a few words on what each type means.

@bubafinder bubafinder merged commit 5d83331 into master Jan 23, 2025
@mbareta mbareta deleted the examples/performance-testing branch January 24, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants