Video in progress
The load test team reported "the service handles 5000 RPS". What questions do you ask from the JVM's point of view?
I ask how long the test ran, whether warm-up was excluded from the numbers, whether a steady state was reached, and how the GC behaved. A 10-minute test doesn't show old gen filling up, Full GCs or slow leaks.
📖 Answer
A JVM application changes over time: first the JIT warms up, then caches fill, then old gen fills slowly and concurrent cycles begin. A short test sees only the first part.
The questions I ask:
- Duration. At least until old gen has filled up and emptied a few times. That is often 1-2 hours. For leaks, a soak test of 8-24 hours.
- Warm-up. Are the first minutes included in the result? If they are, p99 looks worse; if they were dropped entirely, it doesn't show the real experience right after a deploy. Both should be reported separately.
- Coordinated omission. If the load generator waits for the response and only then sends the next request, the waiting during a long GC pause isn't measured, and p99 comes out much nicer than reality. wrk2, Gatling's open model mode or k6's
constant-arrival-ratehandle this better. - Were the GC log and JFR recorded during the test? The heap after GC graph should be flat. Allocation rate × the expected prod RPS lets you estimate the GC frequency in prod.
- Environment. Are the pod size, CPU limit and JVM flags the same as prod? A test on a 16-core laptop says nothing about a pod with a 2 CPU limit.
- Data. Is the cache hit rate realistic? If you test with the same 10 IDs, the cache covers everything.
My usual requirement: along with RPS and p50/p99/p999, the report should include the GC pause distribution, the maximum heap after GC and what share of CPU went to GC. Then it is clear under what conditions "it handles it" is true.
Sign up to mark studied questions and save your progress.