Back to blog

Inside x86 Performance: A Sysbench CPU Comparison

October 26, 2026

Introduction

When benchmarking Postgres across x86 servers from two different vendors using `pgbench -S` workloads (where Server A outperformed Server B by 2.8x to 7.3x), we observed a significant performance gap. This blog isolates core CPU performance from complex system interactions to determine how much of the gap the CPU alone accounts for. While the core CPU architecture and per-cycle scaling explained roughly a 1.6x throughput advantage, the remaining gap under database workloads likely stemmed from factors beyond core speed that we did not measure here, such as memory latency, NUMA topology, and locking.

 

To strip away database noise and isolate the core compute behavior, we needed a purely CPU-bound workload that could do a fixed amount of work per operation and scale seamlessly from a few threads to heavy oversubscription. That led us to investigative benchmarking using Sysbench, moving from high-level throughput sweeps to turbostat frequency analysis and, finally, deep-dive performance counter verification. What we found was a clear picture of per-cycle efficiency that goes far beyond raw frequency numbers.

 

Both test systems were dual-socket enterprise servers featuring 64 cores per socket and two hardware threads per core (256 logical CPUs). To maintain a consistent baseline, both ran RHEL 9.8 and were benchmarked using the same version of sysbench.

First, we evaluated CPU frequency scaling under load by running stress-ng alongside turbostat across a sweeping worker count:

# Sweep CPU load from 1 to 128 workers: stress-ng is pinned to the first n CPUs,
# while turbostat samples per-core busy frequency (Bzy_MHz) and package power (PkgWatt)
for n in 1 8 16 32 64 128; do
  taskset -c 0-$((n-1)) stress-ng --cpu $n --timeout 30s &
  sleep 5
  turbostat --quiet --show Core,Bzy_MHz,PkgWatt --interval 5 --num_iterations 4
  wait
done

We observed a notable difference in CPU frequency between the 2 architectures, and it was consistent from n=1 to n=128.

Once we understood the difference in CPU frequency, we wanted to benchmark the CPU under a sweeping load. The requirement was a purely CPU-bound workload that does a fixed amount of work per operation and can scale from a few threads to heavy oversubscription. Sysbench's CPU test met this: each event is a prime-number calculation up to a set limit.

Analysis of Sysbench data

Full Thread-Count Sweep (sysbench, 120s/stage, 4→2048 threads)

We executed the following sysbench test on both servers under a sweeping load ranging from 4 to 2048 clients.

for i in 4 16 32 64 128 256 512 1024 2048; do
  sysbench cpu --time=120 --threads=$i --cpu-max-prime=20000 --report-interval=10 run
done

We detail the full thread-count sweep below for a thorough review, but the headline story was simple: Server A scaled smoothly up to the 256 logical core limit, maintaining its advantage even with heavy oversubscription.

Threads

Server A

Server B

events/sec ratio (A/B)

events/sec (average)

average latency (ms)

p95 latency (ms)

events/sec (average)

average latency (ms)

p95 latency (ms)

4

8,338.9

0.48

0.48

5,166.4

0.77

0.78

1.61x

16

33,180.0

0.48

0.49

20,623.8

0.78

0.78

1.61x

32

66,258.9

0.48

0.49

41,171.9

0.78

0.78

1.61x

64

132,327.0

0.48

0.49

77,009.1

0.83

0.84

1.72x

128*

225,790.0

0.57

0.92

146,218.2

0.88

0.86

1.54x*

256

278,219.1

0.92

0.92

160,057.9

1.60

1.61

1.74x

512

278,920.0

1.83

13.95

160,064.5

3.20

14.73

1.74x

1024

279,227.0

3.64

24.83

160,025.1

6.39

25.74

1.74x

2048

279,315.6

7.19

56.84

159,982.0

12.75

45.79

1.75x

* n=128 did not reach steady state within the 120s window on either platform.

Server A’s lead was 1.6x at low load and widened to about 1.75x at full load. Across the whole range, Server A delivered roughly 1.6–1.75x Server B’s throughput, including at the lightest-loaded point tested (n=4: 1.61x). That gap was notably larger than the single-core clock-speed difference seen in the turbostat sweep (Server A ~4406 MHz vs Server B ~3896 MHz at n=1, ~13% higher clock), suggesting Server A’s advantage was not explained by clock speed alone — it also completed more work per cycle (higher IPC). We analyze this in detail below with perf-counter measurements.

IPC / Perf-Counter Verification (single-thread)

To confirm the IPC hypothesis above rather than inferring it from throughput and clock alone, we ran `perf stat -e cycles,instructions,task-clock` against the single-threaded `sysbench cpu --cpu-max-prime=20000 --time=120` workload on both platforms:

# perf stat -e cycles,instructions,task-clock \
  sysbench cpu --threads=1 --cpu-max-prime=20000 --time=120 run

 

Metric

Server A

Server B

Cycles

532,597,135,735

468,195,797,188

Instructions

841,054,890,854

523,770,265,409

Effective frequency

4.438 GHz

3.902 GHz

IPC (instructions/cycle)

1.58

1.12

sysbench events/sec

2,079.64

1,294.67

Total events (120s)

249,561

155,363

Instructions per event

3,370,138

3,371,268

The table shows a single run. Three repeated runs agreed to about 0.3% RSD (relative standard deviation), and the A/B throughput ratio held steady at 1.60.

IPC was 41% higher on Server A (1.58 vs 1.12), and its effective clock was about 14% higher (4.438 vs 3.902 GHz). Together, that yielded roughly 1.14 × 1.41 ≈ 1.6x, matching the throughput ratio. Because effective frequency is cycles divided by run time, this represents a breakdown of the gap into clock and IPC rather than an independent confirmation.

To show this, we can break the 1.6x throughput ratio into its two factors: clock frequency and per-cycle efficiency.

Breakdown of the throughput ratio:

Frequency ratio = Server A GHz / Server B GHz = 4.438 / 3.902  = 1.138
IPC ratio = Server A IPC / Server B IPC = 1.58 / 1.12 = 1.411
Combined ratio = Frequency ratio x IPC ratio = 1.138 x 1.411 = 1.606
Measured ratio = Server A events/sec / Server B events/sec = 2,079.64 / 1,294.67 = 1.606

This holds for sysbench's compute-bound loop. IPC depends on the workload, so the split between clock and IPC can vary across applications.

Both servers ran RHEL 9.8 and the same sysbench version. Instructions per event were nearly identical across both platforms (about 3.37 million, a 0.03% difference), so both CPUs performed essentially the same amount of work per prime-check. Their IPC values are therefore directly comparable, proving that the IPC difference reflects a genuine per-cycle efficiency gap rather than an artifact of unequal workload sizes.

Because Sysbench's CPU workload heavily relies on integer division, this IPC advantage likely reflects the efficiency of specific arithmetic units rather than a blanket per-cycle gain across all instruction types.

Conclusion

Finally, our multi-threaded and single-threaded Sysbench runs—backed by perf-counter verification—helped clarify the architectural performance gap between our two test platforms. While the raw data in our thread-count sweep confirms the scaling behavior, the real story lies in the efficiency breakdown: Server A’s 1.6x overall throughput advantage was driven by a powerful combination of a ~14% higher effective clock and a 41% higher IPC (1.58 vs. 1.12).

Share this