JMeter配置咨询:实现100线程执行后添加15秒等待的循环负载测试
Hey there! Let's break down exactly how to set up this repeating load pattern where 100 threads spin up in 1 second, run your HTTP request, wait 15 seconds, then repeat the whole cycle indefinitely.
Core Setup Overview
Your goal is to run full batches of 100 threads, wait 15 seconds between batches, and keep this going. Here's the most reliable way to do it with standard JMeter components:
Step 1: Configure Your Base Thread Group
First, set up the Thread Group with your core parameters:
- Number of Threads: 100 (this is the batch size per cycle)
- Ramp-up Time: 1 second (gets all 100 threads running in 1 second)
- Loop Count: 1 (each thread only runs the HTTP request once per batch)
Inside this Thread Group, add your HTTP Request1 as you already planned.
Step 2: Add a Loop Controller for Cyclic Execution
Wrap the entire Thread Group inside a Loop Controller (add it directly under your Test Plan, then move the Thread Group into it). Set the loop count to Forever (or a specific number if you need a fixed number of cycles). This tells JMeter to repeat the entire batch process over and over.
Step 3: Add a Global 15-Second Delay Between Batches
To get the 15-second wait after each full batch completes, add a Constant Timer right after the Thread Group (still inside the Loop Controller). Set the timer's Thread Delay to 15000 milliseconds (that's 15 seconds).
Final Structure Visualization
Test Plan └── Loop Controller (Loop Count: Forever) ├── Thread Group (100 threads, 1s ramp-up, 1 loop) │ └── HTTP Request1 └── Constant Timer (Delay: 15000 ms)
Why This Works
- The Loop Controller triggers a new batch execution each cycle.
- First, the Thread Group runs: 100 threads start in 1 second, each executes
HTTP Request1once, then the entire Thread Group finishes. - The Constant Timer then pauses the entire test for 15 seconds before the Loop Controller starts the next batch of 100 threads.
Alternative (Less Flexible) Approach: Thread Group Scheduler
If you prefer using the Thread Group's built-in scheduler (note: this only works if your HTTP request execution time is consistent), here's how:
- Keep the Thread Group parameters (100 threads, 1s ramp-up, 1 loop).
- Check the "Scheduler" box.
- Calculate your total cycle time:
1s (ramp-up) + average request execution time + 15s wait. For example, if each request takes 2 seconds, total cycle time is 18 seconds. Set "Duration" to this total time. - Set "Startup Delay" to 0.
But this approach is less reliable if your request times vary—you won't get a consistent 15-second wait after batches finish. The first method is better for guaranteed wait time post-batch.
Quick Tips
- Make sure the Constant Timer is outside the Thread Group—if you put it inside, each thread will wait 15 seconds after their own request, which isn't the batch-level wait you need.
- If you need to stop the test after a certain number of cycles, just change the Loop Controller's count from "Forever" to your desired number of batches.
内容的提问来源于stack exchange,提问作者Harinya

