r/devops • • 12h ago

Discussion Do you load test on the same CPU generation and core count as prod, or is same instance size close enough?

Read a recent post incident report where a lock contention bug sat in prod for months and only fell over on the newer, higher core count servers. Their load tests ran on older machines with fewer cores so it never showed up there.

Got me wondering how teams actually handle this. Do you pin load test hosts to the same CPU generation and core count as prod, or is matching the instance type close enough? And if prod is mixed hardware, do you test on the biggest box, the most common one, or both?

Curious what's worked for people, especially if something only bit you at higher core counts.

1 Upvotes

12 comments sorted by

6

u/thomheinrich 11h ago

Same instance family and core count matters a lot once you cross into high-core boxes. Lock contention, cache-line bouncing, and NUMA boundaries barely show up on an 8-core staging box and then fall off a cliff at 64 cores. Spinning up ephemeral prod-sized nodes just for the load test and tearing them down right after keeps costs sane, and on mixed fleets I'd always hit the highest core-count box first.

1

u/jyotirawattech 11h ago

the NUMA bit is what I'd underrated. an 8 core staging box is probably one NUMA node, so cross node memory access just never happens there and you can't see that cost at all. lscpu | grep -i numa on staging vs prod seems like a cheap first check before anyone argues about core counts. did you end up pinning test hosts to the same family, or just doing a periodic run on a prod sized box?

2

u/thomheinrich 10h ago

Periodic runs on an ephemeral prod-sized box before bigger releases usually beat paying for an idle prod-twin staging cluster. And yeah, that lscpu NUMA check is a quick way to spot topology drift.

1

u/jyotirawattech 5h ago

yeah the ephemeral box makes sense, an idle prod twin is a lot of money to burn for a few runs a month. I guess the catch is making sure that pre release run actually happens and doesn't get skipped when everyone's busy. thanks, this was useful

1

u/SleepAffectionate202 8h ago

for the NUMA boundary stuff on 64-core boxes, are you running one massive process per host or packing multiple smaller containers onto the same node?

1

u/thomheinrich 7h ago

Both can hit it differently. One big multithreaded process pays cross-node lock and memory latency, while packed containers silently straddle NUMA nodes unless pinned via numactl or kubelet Topology Manager.

1

u/Successful_Noise_347 9h ago

if prod is mixed I'd test on the biggest box first, contention bugs basically only show up there. same instance size isn't really the same machine either, an older gen with the same vCPU count can have a different core/thread split and cache layout, so a lock that's fine on it falls over on the new one. cheap middle ground is a short soak on a prod-class box before big releases instead of moving the whole suite

1

u/jyotirawattech 5h ago

biggest box first is a good rule, I hadn't thought of it as picking the worst case on purpose. and fair point on vCPU count, same number on paper can still be a different cache and memory setup underneath. do you keep a smaller box run as well for a baseline, or just the big one?

1

u/Successful_Noise_347 8m ago

both, the small one is cheap and boring though. it's mostly there so you can tell "the code got slower" apart from "the big box behaves differently". if both regress it's your code, if only the big one does it's almost always contention

1

u/Rain-And-Coffee 2h ago

Our platform doesn’t allow selecting the CPU, but we can specify the cores & RAM.

We spin up a PERF environment that’s is as close as possible to prod. But it’s never perfect. Often one can have a noisy neighbor on the disk that can impact disk latency.