Some problems never show up in a 10-minute test. Memory that grows a few megabytes per hour, a connection that is not returned to the pool once in a thousand requests, a disk that fills with logs. They pass every quick test and take production down on a Sunday. A soak test is how you find them first.

What a soak test is

A soak (or endurance) test runs a moderate, constant load for a long time, typically 2 to 24 hours. Not peak load: around 50 to 70% of your normal peak. The point is not to stress the system but to let slow problems accumulate until they become visible.

What it catches

  • Memory leaks: caches without limits, objects held by long-lived references, listeners never removed. Memory climbs steadily until the process is killed or the server swaps.
  • Resource leaks: database connections, file handles or sockets not released. Things work until the pool or the OS limit runs out, then everything fails at once.
  • Growing data: a table without cleanup, a session store that never expires, logs on the same disk as the database.
  • Scheduled jobs: a nightly export or backup that collides with live traffic.
  • Slow degradation: fragmentation, growing indexes, garbage collection pauses that get longer as heaps grow.

How to run one

  1. Pick a realistic journey, the same one as your load test, with think time between steps.
  2. Choose a steady load: about half to two thirds of normal peak.
  3. Run it for hours. Four hours finds most leaks; overnight finds scheduled-job collisions.
  4. Collect metrics for the whole window: memory per process, connections in use, disk usage, garbage collection time, alongside latency and errors.

How to read the result

You are looking for drift: a number that moves while the load does not.

Signal Likely cause
Memory rises steadily and never plateaus Leak or unbounded cache
Memory saw-tooths, peaks get higher each time Leak surviving garbage collection
Latency creeps up hour after hour Growing tables, fragmentation, GC pressure
Sudden failure after hours of calm Pool, file handle or disk exhaustion
Errors at the same clock time A scheduled job

Healthy systems look boring: flat lines with small noise. Compare the first hour with the last hour of the run: the p95 should be about the same.

Fixing what you find

  • Put limits and expiry on every in-process cache.
  • Make sure connections and file handles are closed on every path, including errors.
  • Add retention to tables and logs that grow forever.
  • Move heavy scheduled jobs off peak, or give them their own resources.
  • As a safety net, recycle workers periodically (PHP-FPM pm.max_requests, Gunicorn max_requests), but treat that as a bandage, not a fix.

Soak testing with Hoofbeat

Use the same flow as your regular test with a long, steady phase, and schedule it overnight with a cron expression in your time zone. With Prometheus connected, the run page charts memory, connections and other server metrics for the whole window, next to latency. You get an email or Slack alert only if the run fails, breaks a threshold, or regresses against its baseline. Read about the other test types in load vs stress vs spike vs soak.