What does JMeter's Thread Group checkbox 'Same user on each iteration' change between iterations?
answer
- A checkbox just under Loop Count
- Returning visitor versus new visitor
- The group only publishes a flag
- Ticked by default in a new group
basics
~20 sThe checkbox declares whether a thread's next iteration is the same visitor or a new one. Ticked, which is the default, cookies, cache and the connection carry over the iteration boundary; cleared, they are reset each time.
solid answer
~40 s`Same user on each iteration` is a per-thread declaration stored as `ThreadGroup.same_user_on_next_iteration`, and it defaults to **true** in JMeter 6.0.0. The Thread Group does not clear anything itself — it publishes the flag on the thread, and the elements that hold per-user state read it at the start of each iteration. The HTTP Cookie Manager, HTTP Cache Manager and HTTP Authorization Manager consult it when they are configured to be controlled by the thread group, and the HTTP client applies `httpclient.reset_state_on_thread_group_iteration` only when the box is cleared. So a cleared box means each iteration behaves as a brand-new visitor: cookies and cached entries are dropped, a fresh connection is opened and the TLS state is reset. JMeter's own manual warns that this costs connect and handshake time and more resources per iteration.
go deeper
Know where the checkbox is and which way round it reads: ticked means the thread keeps acting as the same visitor across iterations, and ticked is the default in a new Thread Group.
Explain that the Thread Group only publishes a flag, and name the elements that read it: the HTTP Cookie, Cache and Authorization Managers, plus the connection and TLS reset in the HTTP client.
Connect the setting to the numbers. Show that clearing it adds connect and handshake time to the first sampler of every iteration and adds connection churn on the generator over a long looping run.
Make the choice an explicit part of the scenario definition rather than a checkbox someone toggled, so that returning-visitor and new-visitor runs are never compared as though they measured the same thing.
## What the checkbox is `Same user on each iteration` sits in the Thread Group's `Thread Properties` box, just under `Loop Count`. In a saved plan it is the boolean `ThreadGroup.same_user_on_next_iteration`, and its schema default in JMeter 6.0.0 is **true** — a new Thread Group is created with it ticked. It is a declaration about the meaning of an iteration boundary, not an action: the Thread Group publishes the value on each of its threads and other elements decide what to do with it. ## Who actually reads it Three HTTP configuration elements and the HTTP client itself: - the **HTTP Cookie Manager** re-initialises its cookie store at the start of an iteration when the box is cleared; - the **HTTP Cache Manager** clears its cache under the same condition; - the **HTTP Authorization Manager** discards its cached Kerberos subjects the same way; - the HTTP sampler implementation resets connection and TLS state, honouring the `httpclient.reset_state_on_thread_group_iteration` property only when the box is cleared. With the box ticked, JMeter logs that the group is configured to simulate a returning visitor and ignores that property. The three managers each have their own per-element setting for whether they follow the thread group or their own per-iteration switch, so the Thread Group checkbox governs them only when they are set to be controlled by the thread group. Those element-level options belong to the managers, not to this panel. ## Ticked versus cleared | | ticked (default) | cleared | |---|---|---| | cookies across iterations | kept | dropped | | cached entries | kept | cleared | | connection and TLS state | reused | new connection, TLS renegotiated | | what an iteration models | one returning visitor looping | a fresh visitor each time | | per-iteration cost | lower | higher connect and handshake time | ## Why it changes your numbers On a 200-thread group looping for a fixed hour, the choice shows up twice. First in the results: with the box cleared, every iteration pays a fresh connection and TLS handshake, so the first sampler of each iteration is measurably slower and the mix of recorded times shifts. Second on the generator: cleared means far more connection churn per thread over an hour of looping, which is work the injector does on top of the plan. The manual states both effects plainly — a new connection between iterations, increased response times, more memory and CPU. It also changes what the plan *means*. A login-then-browse plan looping with the box ticked is one signed-in user repeating an activity; the same plan with the box cleared is a stream of new arrivals, each of which must authenticate again. Neither is wrong, but only one of them matches any given scenario, and the checkbox is where that intent is recorded. ## Reading it in an unfamiliar plan 1. Open the Thread Group and note the checkbox state. 2. Check whether the plan even has a Cookie or Cache Manager in scope — with neither, clearing the box still affects connection reuse but changes no stored state. 3. Check the managers' own controlled-by-thread-group setting, since that decides whether they follow the Thread Group at all. 4. Compare against the intended scenario: returning visitor, or new visitor each iteration. ## Common mistakes - Assuming the default is "new user each iteration" — it is the opposite. - Expecting the checkbox to reset JMeter variables or CSV positions; it governs HTTP-side per-user state, not the thread's variables. - Clearing it "to be safe" on a long looping run and then puzzling over slower first samplers and higher generator load. - Believing it needs no managers to have any effect, or conversely that it does nothing without them; connection and TLS reset happen either way.
- Does JMeter's 'Same user on each iteration' checkbox reset a thread's JMeter variables?No. It governs HTTP-side per-user state — the Cookie, Cache and Authorization Managers when they are controlled by the thread group, plus connection and TLS reset. A thread's `JMeterVariables` persist across iterations regardless of the checkbox.
- Which JMeter property does clearing 'Same user on each iteration' allow to take effect?`httpclient.reset_state_on_thread_group_iteration`, which defaults to `true` and closes the open connection and resets SSL state at an iteration boundary. With the checkbox ticked JMeter logs that it is simulating a returning visitor and ignores that property.
saying these in an interview costs you the question
- Says the box is cleared by default in a new Thread Group.
- Thinks it resets JMeter variables or a CSV data set position.
- Claims clearing it has no measurable cost on the generator.
- Believes the Thread Group itself clears the cookie store.
- Assumes it applies per sampler rather than per iteration.