Endurance testing in JMeter means running a realistic, steady load for hours or days to expose problems that short tests hide: memory leaks, connection-pool exhaustion, disk fill, and response-time drift. The core move is to separate ramp-up from the measurement window, keep the load flat and repeatable, and watch both JMeter and the system under test so you can tell which side is degrading. A first soak run of 2–8 hours with continuous monitoring will surface most stability issues; the key condition is that you hold throughput steady and compare late-window metrics against an early-window baseline rather than trusting a single average.
This guide walks through the whole workflow, from defining what "endurance" means for your service to building the test plan, sizing the generator, choosing metrics, and interpreting the result. It assumes you already know basic JMeter vocabulary—thread groups, samplers, listeners—and focuses on what changes when you stretch a test from minutes to hours. Specific JMeter behaviors described here are stable across the 5.x line and have carried into 5.6.x; if you're on an older release or a heavily customized install, verify the exact menu names against your version.
What endurance testing actually measures, and what it doesn't
A load test answers "how much can this handle?" An endurance test—also called a soak test—answers a different question: "does the way it handles a normal load stay stable over time?" That distinction shapes every design decision.
When you run 200 users for five minutes, you're sampling a mostly warm, freshly started system. Connection pools are filling, caches are cold or just warming, and garbage collection may not have completed a full cycle. Run the same 200 users for twelve hours and you enter a regime where slow leaks, log growth, session accumulation, and thread or connection churn dominate. Many production incidents are of exactly this kind: the service works fine on deploy, then falls over on day three.
Endurance testing won't tell you the maximum throughput. It won't validate scaling behavior under burst traffic, and it won't substitute for spike or stress tests. If you run a soak at a load above the system's comfortable operating point, you're really stress-testing, and anything you find may not apply to production conditions. The whole value of the test depends on picking a load level the system is expected to sustain indefinitely, and then holding it there without flinching.
A practical definition helps. For most web services, that's a load equal to the expected peak concurrent-user count, or a percentage of the measured capacity—commonly cited ranges are 60–80% of the maximum throughput you've already established with a capacity test. The exact figure is a judgment call, but write it down and justify it, because every result is anchored to that baseline.
Prerequisites before you build anything
Endurance tests are expensive in wall-clock time, so the setup deserves care. Before touching JMeter, confirm four things.
First, you need an established capacity baseline. Without a prior short load test that found the throughput ceiling, you can't choose a sensible soak level. Second, you need monitoring already in place on the system under test: CPU, memory, heap usage, garbage-collection pauses, connection-pool stats, error rates, and disk space. If you can't observe the target, the test produces a number with no explanation behind it.
Third, you need a dedicated, isolated test environment that will stay up for the duration—ideally one that mirrors production in version and configuration, since leaks are often version-specific. Fourth, decide the duration and success criteria before you start. A reasonable first pass is four hours; a full soak for a critical service might run 24–72 hours, but only after the shorter run is clean. Establish thresholds in advance, for example: zero unhandled errors, 95th-percentile response time stays within 110% of the early-window value, and heap usage plateaus rather than climbs.
One more prerequisite is often skipped: clean, versioned test data. If your test writes records, the database grows during the run, and a slow response late in the test may be a data-volume effect rather than a leak. Decide whether that's part of what you're testing—often it is—but state it explicitly.
Building the test plan
A soak test plan is a normal JMeter plan with three structural adjustments: a ramp separated from the hold, a total duration that ends the test automatically, and lightweight result capture.
Start with a Thread Group and set Threads (users) to your chosen soak level. Set Ramp-up to something that reaches full load over a few minutes—long enough to avoid a thundering herd, short enough that the ramp doesn't eat your measurement window. Then set Loop Count to Infinite and tick the "Specify Thread lifetime" option: Duration to the soak length in seconds, and Startup Delay to zero. Duration is the critical setting; it lets the test terminate without a human watching a clock. Success at the end of the thread group means the test ran to completion, not that the system passed.
Structure the plan with a Transaction Controller wrapping the realistic user journey, so each virtual user executes a believable sequence (for example, authenticate, browse, submit, log out) rather than hammering one endpoint. Keep samplers realistic but lean. Timers matter: without a pacing timer, "200 users" means "200 users firing as fast as they can," which drifts toward stress testing. A Constant Throughput Timer or Precise Throughput Timer inside the thread group paces requests to a target rate and is what keeps load flat for the whole run. If your goal is a fixed request rate rather than fixed concurrency, the throughput timer is the control that makes the test repeatable.
Two settings protect the test from false signals. Set reasonable response timeouts on samplers—a request that hangs for 30 minutes before failing will skew your late-window metrics. And enable keep-alive behavior consistent with production; connection reuse changes how quickly pools exhaust.
For distributed tests, JMeter's server-agent model works, but a soak multiplies its fragility. Prefer a single well-sized generator if it can produce the load, and go distributed only when you must. If you do, synchronize all agents to start at the same wall-clock moment and account for clock drift, which shows up over long runs.
Sizing the load generator so JMeter isn't the flaky component
The most common failure in a long endurance test is that JMeter itself runs out of something and pins the blame on the target. A generator running at 90% CPU for twelve hours will produce response-time drift that has nothing to do with your service.
Estimate generator load before the soak by running a 20–30 minute pilot at target throughput and watching the generator's CPU and heap. As a rule of thumb, keep generator CPU well below saturation—under 70% is a safe target—because headroom lets you see the system under test without the tool becoming the bottleneck. Reduce per-thread cost with these settings:
Use the CLI in non-GUI mode: jmeter -n -t plan.jmx -l results.jtl. The GUI is for building, never for running long tests; its listeners consume memory continuously. Disable all listeners in the plan except a simple one, and write results to a JTL file instead. Raise the JVM heap in jmeter.sh/jmeter.bat (or via HEAP environment variables) to something like 4–8 GB, and size the machine accordingly. Monitor GC on the generator too; a stop-the-world pause in JMeter appears as a latency spike downstream. Keep response data out of the results file. Save only what the run needs—timestamp, label, elapsed, response code, success—and skip full response bodies. Expect the JTL file to grow steadily; a long soak at high rates can produce gigabytes. Plan disk space and, if needed, use a rotating writer or generate only aggregated output. Writing to the same disk you're testing is a recipe for confusing results.
If you need per-second statistics, compute them after the run from the JTL with a small script or jmeter -g, rather than keeping live listeners attached. Aggregating after the fact costs nothing during the soak.
Running the soak and capturing the right metrics
Start the run from the command line, note the wall-clock start time, and let it go. During the run, avoid interacting with the generator beyond read-only monitoring, and never restart it mid-soak if you want a clean time series.
Capture two streams of data. On the target side, your monitoring stack should record per-minute CPU, memory and heap in use, GC pause totals, open connections, error rates, queue depths, and disk usage. On the JMeter side, the JTL gives you response times and success codes per sample. Both streams need timestamps so you can align them.
Then, when the run finishes, split the JTL into an early window and a late window—for example, the second and eleventh hours of a twelve-hour run, skipping the ramp and the final minutes. Compare the same statistics across the two windows at the same throughput. This is the single most important analytical move in an endurance test, because a full-run average hides drift: if latency climbs steadily from 80 ms to 400 ms, the average looks fine and the conclusion is wrong. A tool like JMeter Plugins' custom graphs, or a quick script over the JTL, makes per-window comparison straightforward. Do this on the raw data rather than eyeballing a single chart, and record the exact window boundaries with the results so the comparison is reproducible.
A worked example makes the arithmetic concrete. Suppose the early window shows a 95th percentile of 120 ms at 1,000 requests per second, and the late window shows 210 ms at the same rate. The increase is 90 ms, or a 75% rise in the 95th percentile. That's a stability red flag even though the average may have moved only slightly. Label such figures clearly as the measured result of a specific run, not a general benchmark—your numbers will differ with target, load level, and window choice.
Reading the result: separating JMeter artifacts from real problems
A rising response-time curve during a soak is a symptom, not a diagnosis. Use the paired monitoring data to locate the cause before acting.
If the generator's CPU or memory climbs in step with latency, suspect JMeter first. Common culprits: an aggressive timer or per-sample listener consuming memory, an unbounded results file slowing disk writes, or too many threads on one JVM. Re-run a shorter version with half the load and see whether the curve flattens; if it does, the generator was the constraint.
If the target's heap grows steadily without a corresponding rise in live-object metrics, that's the classic leak signature: memory per request accumulating until GC can't keep up. If heap is flat but connection counts climb, look at pool sizing or connection leaks in the code. If disk fills, check log rotation and any feature that writes per-request. If error rates stay near zero but throughput sags, look for thread-pool exhaustion, queue backlogs, or downstream dependency saturation.
A frequent false alarm: response times rising in the late window because the database now contains hours of test data. Compare against a control—a re-run with the same data volume inserted up front—to distinguish data-volume effects from time-dependent leaks. Similarly, scheduled jobs, backups, or monitoring scans that run on a timer can ping the system mid-soak; check the target's maintenance schedule and note it against the timeline. Distinguishing these from genuine leaks is the difference between a useful report and a scare.
Making endurance testing repeatable and part of the routine
The results of a single soak are provisional. To make them useful over time, version the JMX file alongside the test data and the chosen load level, and record the exact JMeter version and JVM settings used. The same plan run on a different version of JMeter, or with different heap settings, is a different experiment.
Turn the comparison step into a small, scripted step: pull the JTL, compute early- and late-window statistics, and emit a pass/fail against your pre-declared thresholds. Add it to the CI pipeline on a nightly schedule for a staging environment that otherwise sits idle. The first clean run gives you a baseline; every subsequent run tells you whether stability changed. Treat regressions as defects, and treat improvements as requiring explanation—if latency drops after a deploy, confirm the load was actually the same.
Two maintenance habits keep the suite honest. Re-validate the load level whenever the service's capacity baseline moves, because a soak at a stale level tests the wrong system. And rotate test duration deliberately: short 2–4 hour runs for routine checks, long 24–72 hour runs before major releases or after a change that touches resource handling, like a new cache or connection library. Duration should follow risk, not habit.
The limiting factor is usually time and environment availability, not technique. A well-built plan, an isolated target, and an early-versus-late comparison give you most of the value for a few hours of runtime—and honestly, that's a better return than a 48-hour soak with no baseline to compare it to.