Skip to content

Commit c075fd1

Browse files
committed
test(metrics): retain CPU-bound PostgreSQL and reviewed-head evidence
1 parent 38468b8 commit c075fd1

16 files changed

Lines changed: 465 additions & 1 deletion

‎benchmarks/metrics-native-20261126/README.md‎

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
- Baseline: `453639f671ae3e4da45eac0fdd791a99eb68c607`, official OTel 1.44.0 aggregation.
66
- Native implementation: `743ce8a973e89cf30251dc980efa9ff008cd50a9`, OTel 1.44.0 retained.
7-
- Final measured candidate: that implementation plus the dependency-only diff committed as `cb0c8e52c7c65d7a0b5f0093d0102454c38e9235`; OTel 1.47.0, OTLP schemas 1.11.0, grpc-gateway 2.30.0. No `replace` directives.
7+
- Initial measured candidate: that implementation plus the dependency-only diff committed as `cb0c8e52c7c65d7a0b5f0093d0102454c38e9235`; OTel 1.47.0, OTLP schemas 1.11.0, grpc-gateway 2.30.0. No `replace` directives.
8+
- Reviewed implementation: `38468b80e504e2412647a1908b27f243baf4b970`, with regression fixes for rejected-series bindings, sampled delta reservoir reuse, and explicit empty histogram bounds. Its gates were rerun separately.
89
- Apple M5 Pro, macOS arm64, 18 logical CPUs, Go 1.27.4. Both CLI binaries built with the repository's `make build`, without PGO.
910
- `GOMAXPROCS=4`, `GOGC=100`, `GOMEMLIMIT=off`. This limits Go execution parallelism; it is **not physical CPU affinity**.
1011
- Built-in `baseline` workload, noop driver, `--steps workload`, `constant-vus`, no database I/O or load phase. Default 30-second drain; actual measured time includes drain.
@@ -63,6 +64,13 @@ setting. Median block changes were -0.26% with export off (range -0.55% to -0.12
6364
and +0.02% with export on (range -0.48% to +1.30%). All 24 runs were clean.
6465
These small differences do not support a dependency speedup or material regression.
6566

67+
The reviewed implementation passed another 36-run executable gate: +44.62%
68+
serial, +41.09% at 100 VUs, and +42.26% at 256 VUs. A separate 24-run 100-VU
69+
matrix gave +42.14% with OTLP off and +87.48% on. All runs were clean.
70+
`reviewed-gate-summary.json`, `reviewed-export-summary.json`, and
71+
`reviewed-reports.tar.gz` retain current-code evidence; `reviewed-binary.sha256`
72+
identifies the measured binary.
73+
6674
## Recording, collection, and complete transactions
6775

6876
Separate existing Go benchmarks compare each material change. Raw results are
@@ -114,6 +122,46 @@ No workload/error checks were changed. The task-owned PostgreSQL container was
114122
stopped afterward. `docker-tpcb-runs.jsonl` and `docker-tpcb-reports.tar.gz` retain
115123
results, commands, image identity, external counts, and discarded-attempt evidence.
116124

125+
## Client-limited PostgreSQL follow-up
126+
127+
To isolate client CPU cost, matched Linux/arm64 binaries were built from unchanged
128+
`453639f` and candidate `2df230f`. Both ran in task-owned containers sharing the
129+
PostgreSQL network namespace, removing Docker Desktop's host-port forwarding.
130+
Client CPU quotas and `GOMAXPROCS` were both set to one or two; PostgreSQL had no
131+
container CPU quota inside Docker's six-vCPU VM. This is CPU quota isolation,
132+
not physical CPU affinity or separate hardware.
133+
134+
TPC-B SF16, eight VUs, eight connections, explicit READ COMMITTED, OTLP off, one
135+
fresh analyzed-template clone per invocation, five-second warmup, history reset,
136+
then 20 seconds measured. Three ABBA blocks per target. Client CPU came from
137+
cgroup `usage_usec` around the measured process. History row counts exactly
138+
matched reported successful transactions in every measured run.
139+
140+
| Client quota | Baseline median block TPS | Candidate median block TPS | Median paired gain | Block gain range | Client CPU used |
141+
| --- | ---: | ---: | ---: | ---: | --- |
142+
| 1 CPU, 8 VUs | 21,728.56 | 22,683.15 | **+4.71%** | +3.09% to +4.98% | approximately 99% of one CPU |
143+
| 2 CPUs, 8 VUs | 23,812.59 | 24,377.88 | **+2.37%** | +1.05% to +4.19% | approximately 1.31–1.33 CPUs |
144+
145+
The one-CPU result is a real-database throughput improvement from a client-only
146+
change: all three paired blocks improve, the client saturates its quota, and the
147+
database can sustain higher work rates. The two-CPU result is mixed-limit, not a
148+
fully CPU-saturated client result. A four-CPU/32-VU ABBA headroom control reached
149+
29,282.97 baseline and 30,574.37 candidate TPS; the same-eight-VU/four-CPU control
150+
remained near 24k TPS. Neither target exhausted PostgreSQL's aggregate capacity,
151+
but eight-VU round trips and scheduling still constrain two-CPU throughput.
152+
153+
Earlier macOS host clients at `GOMAXPROCS=1/2` reached only approximately 4.4k/4.3k
154+
TPS and used 55%/75% of one CPU. Those valid observations are retained as a
155+
port-forwarded mixed-limit control, not substituted for the CPU-bound result.
156+
No failure was hidden: all 60 host/Linux runs across target and headroom cases
157+
completed without errors and matched external committed-work counts.
158+
159+
`postgres-client-cpu-summary.json`, the `postgres-*-results-*.jsonl` files, and
160+
`postgres-client-cpu-reports.tar.gz` retain reports, scripts, cgroup samples,
161+
Linux binary checksums, and image identity. PostgreSQL was stopped afterward.
162+
These client-limit measurements precede the three reviewed edge-case fixes;
163+
current-code noop/export gates above were rerun after those fixes.
164+
117165
## Correctness boundary
118166

119167
- Differential aggregation against official SDK emission at 1/100/256 workers checks names, units, descriptions, attribute sets, monotonicity/temporality, counter/rate totals, histogram counts/bounds/buckets/extrema, and gauge last values.
Binary file not shown.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
[
2+
{
3+
"cpus": 1,
4+
"vus": 8,
5+
"a_median": 21728.56437831986,
6+
"b_median": 22683.153699516188,
7+
"gain_median": 4.711207250922955,
8+
"gain_range": [
9+
3.0900069163640076,
10+
4.983279752285763
11+
],
12+
"cpu_a": 99.20728434828033,
13+
"cpu_b": 99.58451104169691,
14+
"blocks": [
15+
{
16+
"cpus": 1,
17+
"vus": 8,
18+
"block": 1,
19+
"a": 21897.124463282067,
20+
"b": 22573.74712368232,
21+
"cpu_a": 99.38218385123734,
22+
"cpu_b": 99.59410210794547,
23+
"gain_pct": 3.0900069163640076
24+
},
25+
{
26+
"cpus": 1,
27+
"vus": 8,
28+
"block": 2,
29+
"a": 21606.444143332563,
30+
"b": 22683.153699516188,
31+
"cpu_a": 98.80039676214648,
32+
"cpu_b": 99.58451104169691,
33+
"gain_pct": 4.983279752285763
34+
},
35+
{
36+
"cpus": 1,
37+
"vus": 8,
38+
"block": 3,
39+
"a": 21728.56437831986,
40+
"b": 22752.24207883273,
41+
"cpu_a": 99.20728434828033,
42+
"cpu_b": 99.24389367699611,
43+
"gain_pct": 4.711207250922955
44+
}
45+
]
46+
},
47+
{
48+
"cpus": 2,
49+
"vus": 8,
50+
"a_median": 23812.594754801612,
51+
"b_median": 24377.878698869772,
52+
"gain_median": 2.373886381928947,
53+
"gain_range": [
54+
1.0492144139786719,
55+
4.185423517934184
56+
],
57+
"cpu_a": 132.69418477009646,
58+
"cpu_b": 131.11088260717787,
59+
"blocks": [
60+
{
61+
"cpus": 2,
62+
"vus": 8,
63+
"block": 1,
64+
"a": 23527.95462127103,
65+
"b": 24512.699167278588,
66+
"cpu_a": 131.48800464911994,
67+
"cpu_b": 131.21913662990414,
68+
"gain_pct": 4.185423517934184
69+
},
70+
{
71+
"cpus": 2,
72+
"vus": 8,
73+
"block": 2,
74+
"a": 23812.594754801612,
75+
"b": 24377.878698869772,
76+
"cpu_a": 132.69418477009646,
77+
"cpu_b": 131.11088260717787,
78+
"gain_pct": 2.373886381928947
79+
},
80+
{
81+
"cpus": 2,
82+
"vus": 8,
83+
"block": 3,
84+
"a": 24050.75777858695,
85+
"b": 24303.10179587098,
86+
"cpu_a": 134.95717998743964,
87+
"cpu_b": 128.92938233541958,
88+
"gain_pct": 1.0492144139786719
89+
}
90+
]
91+
},
92+
{
93+
"cpus": 4,
94+
"vus": 8,
95+
"a_median": 23478.300133091845,
96+
"b_median": 24235.952679565307,
97+
"gain_median": 3.22703322718656,
98+
"gain_range": [
99+
3.22703322718656,
100+
3.22703322718656
101+
],
102+
"cpu_a": 156.42578823229886,
103+
"cpu_b": 155.77639448520915,
104+
"blocks": [
105+
{
106+
"cpus": 4,
107+
"vus": 8,
108+
"block": 1,
109+
"a": 23478.300133091845,
110+
"b": 24235.952679565307,
111+
"cpu_a": 156.42578823229886,
112+
"cpu_b": 155.77639448520915,
113+
"gain_pct": 3.22703322718656
114+
}
115+
]
116+
},
117+
{
118+
"cpus": 4,
119+
"vus": 32,
120+
"a_median": 29282.96913072832,
121+
"b_median": 30574.369557145623,
122+
"gain_median": 4.4100733796907265,
123+
"gain_range": [
124+
4.4100733796907265,
125+
4.4100733796907265
126+
],
127+
"cpu_a": 159.48603659694794,
128+
"cpu_b": 160.08352758712493,
129+
"blocks": [
130+
{
131+
"cpus": 4,
132+
"vus": 32,
133+
"block": 1,
134+
"a": 29282.96913072832,
135+
"b": 30574.369557145623,
136+
"cpu_a": 159.48603659694794,
137+
"cpu_b": 160.08352758712493,
138+
"gain_pct": 4.4100733796907265
139+
}
140+
]
141+
}
142+
]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{"variant":"base","cpus":1,"vus":8,"block":1,"position":1,"tps":21955.476970165113,"transactions":439116,"history":439116,"seconds":20.000294259,"client_cpu_seconds":19.855858,"client_cpu_percent":99.27782933026096,"db_cpu_seconds_including_warmup":69.153411,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
2+
{"variant":"native-147","cpus":1,"vus":8,"block":1,"position":2,"tps":22735.58639906417,"transactions":454717,"history":454717,"seconds":20.000231884,"client_cpu_seconds":19.917971,"client_cpu_percent":99.58870034869041,"db_cpu_seconds_including_warmup":68.856644,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
3+
{"variant":"native-147","cpus":1,"vus":8,"block":1,"position":3,"tps":22411.907848300463,"transactions":448243,"history":448243,"seconds":20.000216092,"client_cpu_seconds":19.920116,"client_cpu_percent":99.59950386720053,"db_cpu_seconds_including_warmup":68.995193,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
4+
{"variant":"base","cpus":1,"vus":8,"block":1,"position":4,"tps":21838.77195639902,"transactions":436781,"history":436781,"seconds":20.000254633,"client_cpu_seconds":19.897561,"client_cpu_percent":99.48653837221373,"db_cpu_seconds_including_warmup":67.928619,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
5+
{"variant":"base","cpus":1,"vus":8,"block":2,"position":5,"tps":21586.548848371902,"transactions":431738,"history":431738,"seconds":20.000325343,"client_cpu_seconds":19.707924,"client_cpu_percent":98.53801706729567,"db_cpu_seconds_including_warmup":69.711067,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
6+
{"variant":"native-147","cpus":1,"vus":8,"block":2,"position":6,"tps":22492.17774321226,"transactions":449851,"history":449851,"seconds":20.00033101,"client_cpu_seconds":19.924847,"client_cpu_percent":99.62258619638716,"db_cpu_seconds_including_warmup":68.594641,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
7+
{"variant":"native-147","cpus":1,"vus":8,"block":2,"position":7,"tps":22874.129655820114,"transactions":457489,"history":457489,"seconds":20.000280093,"client_cpu_seconds":19.909566,"client_cpu_percent":99.54643588700665,"db_cpu_seconds_including_warmup":69.027689,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
8+
{"variant":"base","cpus":1,"vus":8,"block":2,"position":8,"tps":21626.339438293227,"transactions":432532,"history":432532,"seconds":20.000240967,"client_cpu_seconds":19.812794,"client_cpu_percent":99.06277645699727,"db_cpu_seconds_including_warmup":69.029473,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
9+
{"variant":"base","cpus":1,"vus":8,"block":3,"position":9,"tps":21792.54403159217,"transactions":435857,"history":435857,"seconds":20.000280801,"client_cpu_seconds":19.955204,"client_cpu_percent":99.77461915935828,"db_cpu_seconds_including_warmup":66.74964,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
10+
{"variant":"native-147","cpus":1,"vus":8,"block":3,"position":10,"tps":22700.778479393724,"transactions":454021,"history":454021,"seconds":20.000239217,"client_cpu_seconds":19.914868,"client_cpu_percent":99.57314902050052,"db_cpu_seconds_including_warmup":68.615484,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
11+
{"variant":"native-147","cpus":1,"vus":8,"block":3,"position":11,"tps":22803.705678271737,"transactions":456080,"history":456080,"seconds":20.000258135,"client_cpu_seconds":19.783183,"client_cpu_percent":98.9146383334917,"db_cpu_seconds_including_warmup":71.807224,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
12+
{"variant":"base","cpus":1,"vus":8,"block":3,"position":12,"tps":21664.584725047556,"transactions":433298,"history":433298,"seconds":20.000291051,"client_cpu_seconds":19.728277,"client_cpu_percent":98.63994953720236,"db_cpu_seconds_including_warmup":70.032585,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{"variant":"base","cpus":2,"vus":8,"block":1,"position":1,"tps":23342.5415355924,"transactions":466858,"history":466858,"seconds":20.000307134,"client_cpu_seconds":26.141976,"client_cpu_percent":130.70787275841042,"db_cpu_seconds_including_warmup":71.699544,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
2+
{"variant":"native-147","cpus":2,"vus":8,"block":1,"position":2,"tps":24561.057566051255,"transactions":491228,"history":491228,"seconds":20.000278843,"client_cpu_seconds":26.353343,"client_cpu_percent":131.7648779143074,"db_cpu_seconds_including_warmup":70.529118,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
3+
{"variant":"native-147","cpus":2,"vus":8,"block":1,"position":3,"tps":24464.340768505917,"transactions":489292,"history":489292,"seconds":20.000211926,"client_cpu_seconds":26.134956,"client_cpu_percent":130.67339534550092,"db_cpu_seconds_including_warmup":71.453598,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
4+
{"variant":"base","cpus":2,"vus":8,"block":1,"position":4,"tps":23713.36770694966,"transactions":474274,"history":474274,"seconds":20.000280258,"client_cpu_seconds":26.453998,"client_cpu_percent":132.2681365398295,"db_cpu_seconds_including_warmup":70.905118,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
5+
{"variant":"base","cpus":2,"vus":8,"block":2,"position":5,"tps":24150.611025646238,"transactions":483019,"history":483019,"seconds":20.000280717,"client_cpu_seconds":26.868013,"client_cpu_percent":134.33817944946398,"db_cpu_seconds_including_warmup":69.396634,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
6+
{"variant":"native-147","cpus":2,"vus":8,"block":2,"position":6,"tps":24527.915949407103,"transactions":490565,"history":490565,"seconds":20.000272384,"client_cpu_seconds":26.330399,"client_cpu_percent":131.65020202956853,"db_cpu_seconds_including_warmup":70.994772,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
7+
{"variant":"native-147","cpus":2,"vus":8,"block":2,"position":7,"tps":24227.84144833244,"transactions":484565,"history":484565,"seconds":20.000337258,"client_cpu_seconds":26.114753,"client_cpu_percent":130.57156318478718,"db_cpu_seconds_including_warmup":71.65609,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
8+
{"variant":"base","cpus":2,"vus":8,"block":2,"position":8,"tps":23474.578483956982,"transactions":469498,"history":469498,"seconds":20.000273927,"client_cpu_seconds":26.210397,"client_cpu_percent":131.05019009072896,"db_cpu_seconds_including_warmup":71.164919,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
9+
{"variant":"base","cpus":2,"vus":8,"block":3,"position":9,"tps":24094.800161572755,"transactions":481903,"history":481903,"seconds":20.000290385,"client_cpu_seconds":26.827249,"client_cpu_percent":134.13429747060147,"db_cpu_seconds_including_warmup":69.455571,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
10+
{"variant":"native-147","cpus":2,"vus":8,"block":3,"position":10,"tps":24655.50912649135,"transactions":493117,"history":493117,"seconds":20.000276509,"client_cpu_seconds":25.92875,"client_cpu_percent":129.64195764159672,"db_cpu_seconds_including_warmup":71.830289,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
11+
{"variant":"native-147","cpus":2,"vus":8,"block":3,"position":11,"tps":23950.694465250614,"transactions":479019,"history":479019,"seconds":20.000213384,"client_cpu_seconds":25.643635,"client_cpu_percent":128.21680702924246,"db_cpu_seconds_including_warmup":72.367156,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
12+
{"variant":"base","cpus":2,"vus":8,"block":3,"position":12,"tps":24006.71539560115,"transactions":480141,"history":480141,"seconds":20.000278759,"client_cpu_seconds":27.156391,"client_cpu_percent":135.78006250427782,"db_cpu_seconds_including_warmup":69.336846,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"variant":"base","cpus":4,"vus":32,"block":1,"position":1,"tps":29540.105448546903,"transactions":590830,"history":590830,"seconds":20.000944175,"client_cpu_seconds":32.204684,"client_cpu_percent":161.01581864447158,"db_cpu_seconds_including_warmup":93.614118,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
2+
{"variant":"native-147","cpus":4,"vus":32,"block":1,"position":2,"tps":30962.799984049856,"transactions":619280,"history":619280,"seconds":20.000775134,"client_cpu_seconds":32.300576,"client_cpu_percent":161.49662092391182,"db_cpu_seconds_including_warmup":92.991572,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
3+
{"variant":"native-147","cpus":4,"vus":32,"block":1,"position":3,"tps":30185.93913024139,"transactions":603738,"history":603738,"seconds":20.000636634,"client_cpu_seconds":31.735097,"client_cpu_percent":158.67043425033808,"db_cpu_seconds_including_warmup":93.331543,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}
4+
{"variant":"base","cpus":4,"vus":32,"block":1,"position":4,"tps":29025.832812909735,"transactions":580537,"history":580537,"seconds":20.000700884,"client_cpu_seconds":31.592358,"client_cpu_percent":157.9562545494243,"db_cpu_seconds_including_warmup":93.815789,"errors":{"terminal_errors":0,"failed_iterations":0,"failed_queries":0,"retry_attempts":0,"groups":[]}}

0 commit comments

Comments
 (0)