Test old bird sorting, Jmeter common thread group + scene instance, a speed pass test...


foreword

Jmeter uses thread groups to simulate large user concurrency scenarios

1、Thread Group

The action to be executed after the sampler error:
Continue: Continue to execute when an error occurs, without affecting the scene running. The default is to continue, commonly used.
Start Next Thread Loop: Execute the next loop, and the remaining samplers in the current loop will no longer be executed.

Stop thread: Stop the current thread, and other threads continue to execute.
Stop Test: Stop the test after executing the remaining threads.
Stop Test Now: Stops all threads immediately.

Thread attribute:
Number of threads: the number of concurrency, as shown in the figure, set to 100 concurrent
Ramp-Up Period (in seconds): the loading time of concurrent users, as shown in the figure, set it to 1s, and 100 concurrency will be loaded within 1s during execution

Number of cycles/forever: Fill in the specific number, which is the number of concurrent execution cycles. In one scene, the number of requests = number of threads * number of cycles; if you choose forever, it will continue to execute unless manually stopped.

Delay Thread creation until needed: Delay thread creation until it is known to be needed.
Scheduler: After checking, the configuration item settings of the scheduler will take effect, and you can set the continuous execution time of the scene, the delayed start time, the start time, and the end time.

Duration: How long the scene continues to execute
Start Delay: How long to delay execution

C1

2、jp@gc - Stepping Thread Group (deprecated)

When installing Jmeter for the first time, you cannot see jp@gc - Stepping Thread Group (deprecated) and jp@gc - Ultimate Thread Group, because these two thread groups are provided by Jmeter Plugins.

Installation steps:
Open Jmeter, menu bar, option "Plugins Manager" Custom Thread Groups component installation, restart Jmeter after installation, right click to add thread group to see.

Parameter description:
This group will start: Number of threads, 100 threads in the picture First
wait for:
How long does the first thread delay to start, the picture above is 0 seconds Load 10 threads within, and then load 10 more every 1s, and it takes 9s to load 100 threads.


Then hold load for: How long does it last to run after all threads are loaded, in s. The above picture shows that all 100 threads are loaded and run continuously for 60s. That is, 100 runs concurrently for 60s.

Finally stop/threads every: How many threads are stopped for how long. The above picture shows that 10 threads are stopped within 1 second, and it takes 9 seconds to stop 100 threads
.

C2

Scenario example:

The maximum concurrency is 300, 100 concurrency and 100 concurrency increase pressure, every 100 concurrency lasts for 30s, after reaching 300 concurrency, it continues to run for 60s, and then ends immediately

Scenario analysis:
Just check the number according to the data in the scenario. Realize as shown in the figure

C3

3、jp@gc - Ultimate Thread Group

Parameter description:
Start Thread Count: The number of starting threads, that is, the number of concurrency, 10 concurrency in the figure.
Initial Dealay, sec: Thread delay running time, 0 in the figure, and no delay in starting.
Startup Time, Sec: thread loading time, 10s in the figure, that is, 100 threads are started in 10s.
Hold Load For, Sec: continuous running time, 60s in the figure.
Shutdown Time: The length of time to stop the thread, which is 10s in the figure.

Elapsed time=Initial Dealay+Startup Time+Hold Load For+Shutdown Time

C4

Scenario example:

The maximum is 300 concurrency, 100 concurrency increases pressure, and each segment runs for 600s.

Scenario Analysis:
The first paragraph: 100 concurrent runs for 600s;
the second paragraph: 200 concurrent runs for 600s;
the third paragraph: 300 concurrent runs for 600s

Need to calculate: the total duration is 1800s (Hold Load For, sec cannot exceed 1800, and the running time of each segment is 1800, 1200, 600), and the interval of each segment is 600s (Initial Delay, sec is 0,600, 1200).

C5

Through the design of stage scenarios, combined with jp@gc - Transactions per Second, the optimal number of concurrency supported by the system can be found according to the error points

C6

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

Only by working hard can we make our dreams break out of cocoons and become butterflies, and add brilliant colors to life; only after falling down countless times can we stand up and welcome a more brilliant tomorrow. Persevere and never give up, create infinite possibilities for your life!

Only by constantly surpassing one's limits can one feel the power of struggle; only by persistently giving can one create one's own brilliance. No matter how difficult the front is, believe in your ability and bravely chase your dreams, because persistence is the starting point of victory!

Only through twists and turns can you see the light of victory, only with sweat can you reap brilliant results, keep a firm belief, keep making progress, and work hard. Only in this way can you create your own brilliance.

Guess you like

Origin blog.csdn.net/x2waiwai/article/details/131767386