Skip to content

Commit 71bb33e

Browse files
PXB-3862 : TEMPORARY: bundle the validation benchmark kit
https://perconadev.atlassian.net/browse/PXB-3862 Ships pxb-bench (the team's page-tracking benchmark tool, with numeric gap modes enabled) and a from-bare-machine runbook inside the source tree, so validating the measured bridge budget on a new machine needs exactly one git clone. Runs the same 5..100% sweep as the original PXB-3862 report plus a pin-10 column, and collects the calibration and refusal log lines that explain every grouping decision. NOT FOR MERGE: this commit is a distribution vehicle for the multi- machine validation campaign and will be dropped from the branch before the pull request.
1 parent 48cedcd commit 71bb33e

3 files changed

Lines changed: 420 additions & 0 deletions

File tree

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# PXB-3862 read-request-cost validation — from a bare machine
2+
3+
Everything needed is in this checkout: the xtrabackup source (this
4+
repo, branch PXB-3862-8.4) and the benchmark tool (pxb-test.tar.gz in
5+
this directory — jinyou's pxb-bench with numeric gap modes enabled;
6+
17 unit tests included). This file is the complete runbook.
7+
8+
## Quick start — build, then one command
9+
10+
```bash
11+
cmake -S . -B build -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF
12+
cmake --build build --target xtrabackup -j"$(nproc)"
13+
./storage/innobase/xtrabackup/test/benchmarks/run_benchmark.sh
14+
```
15+
16+
run_benchmark.sh does everything below automatically: finds the built
17+
binary, deploys (or reuses) a dbdeployer sandbox named pxb3862_bench,
18+
installs the mysqlbackup component, loads test.sbtest1 with sysbench
19+
when missing (reused when present — reruns after a rebuild skip
20+
straight to the sweep), unpacks pxb-bench, generates config.toml,
21+
picks run-vs-restart mode from table size vs buffer pool, runs the
22+
sweep and prints the path of one results tarball to send back.
23+
Defaults: ROWS=10000000, PERCENTS=5:100:5, GAPS=none,0,auto,10,
24+
WORKLOADS=scattered. Override anything per invocation, e.g. on
25+
jinyou's rig:
26+
27+
```bash
28+
SANDBOX=~/sandboxes/msb_8_4_8 ./run_benchmark.sh # reuse 100M-row sandbox
29+
# or provision fresh from the JIRA layout:
30+
SANDBOX_BINARY=/opt/percona_server MYSQL_VERSION=8.4.8 ROWS=100000000 ./run_benchmark.sh
31+
```
32+
33+
Only the packages in step 0 are prerequisites. The manual steps below
34+
remain the reference for what the script does (and for debugging it).
35+
36+
Path variables used below — set them to taste:
37+
38+
SRC=~/WORK/pxb-3862-8.4 # this repo checkout
39+
SB=~/sandboxes/msb_ps8_4_x # the sandbox (created in step 3)
40+
41+
## 0. Packages (once, ~5 min)
42+
43+
```bash
44+
# Debian/Ubuntu (adjust for RHEL):
45+
sudo apt install -y build-essential cmake bison libssl-dev \
46+
libncurses-dev libaio-dev libcurl4-openssl-dev libudev-dev \
47+
libgcrypt-dev libev-dev libproc2-dev \
48+
python3 python3-pip sysbench wget
49+
```
50+
51+
dbdeployer (single static Go binary; assets are named
52+
dbdeployer-<ver>.linux.tar.gz):
53+
54+
```bash
55+
VER=1.73.0 # or check https://github.com/datacharmer/dbdeployer/releases
56+
mkdir -p ~/bin
57+
wget -q https://github.com/datacharmer/dbdeployer/releases/download/v$VER/dbdeployer-$VER.linux.tar.gz
58+
tar xzf dbdeployer-$VER.linux.tar.gz
59+
mv dbdeployer-$VER.linux ~/bin/dbdeployer && chmod +x ~/bin/dbdeployer
60+
export PATH=$PATH:~/bin # add to ~/.bashrc for permanence
61+
62+
# one-time init: creates ~/opt/mysql (binaries), ~/sandboxes, and
63+
# fetches the tarball download index
64+
dbdeployer init
65+
```
66+
67+
## 1. Source (one clone brings everything)
68+
69+
```bash
70+
git clone -b PXB-3862-8.4 https://github.com/satya-bodapati/percona-xtrabackup.git $SRC
71+
```
72+
73+
## 2. Build xtrabackup (~15 min)
74+
75+
```bash
76+
cd $SRC
77+
cmake -S . -B build -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF
78+
cmake --build build --target xtrabackup -j"$(nproc)"
79+
# sanity - MUST print the option:
80+
build/runtime_output_directory/xtrabackup --help | grep page-tracking-merge-gap
81+
```
82+
83+
## 3. Server sandbox (~5 min)
84+
85+
```bash
86+
# download a Percona Server 8.4 tarball via dbdeployer's index
87+
# (or wget one from percona.com/downloads and skip this line):
88+
dbdeployer downloads get-by-version 8.4 --flavor percona --newest
89+
90+
# make it deployable, then deploy one sandbox:
91+
dbdeployer unpack Percona-Server-8.4*.tar.gz --prefix ps
92+
dbdeployer deploy single ps8.4.<x> # <x> from: dbdeployer versions
93+
SB=~/sandboxes/msb_ps8_4_<x> # dbdeployer prints this path;
94+
# port: grep ^port $SB/my.sandbox.cnf
95+
# recommended for large tables:
96+
printf 'innodb_buffer_pool_size=4G\ninnodb_redo_log_capacity=4G\n' >> $SB/my.sandbox.cnf
97+
$SB/restart
98+
```
99+
100+
## 4. Load the table (100M rows ~ 24GB, ~1h; scale down freely)
101+
102+
```bash
103+
PORT=$(awk -F= '/^port/{gsub(/ /,"");print $2;exit}' $SB/my.sandbox.cnf)
104+
$SB/use -e "CREATE DATABASE IF NOT EXISTS test"
105+
sysbench oltp_insert --tables=1 --table-size=100000000 \
106+
--create_secondary=off --mysql-db=test --db-driver=mysql \
107+
--mysql-host=127.0.0.1 --mysql-port=$PORT \
108+
--mysql-user=msandbox --mysql-password=msandbox prepare
109+
```
110+
111+
## 5. Install the benchmark tool (~2 min)
112+
113+
```bash
114+
tar xzf $SRC/storage/innobase/xtrabackup/test/benchmarks/pxb-test.tar.gz -C $SB
115+
cd $SB/pxb-test && python3 -m pip install --user -e .
116+
```
117+
118+
## 6. config.toml — edit ONLY what has no CLI flag (~1 min)
119+
120+
In `$SB/pxb-test/config.toml` (marked CHANGE-ME):
121+
122+
```toml
123+
[sandbox] port = <the $PORT from step 4>
124+
[xtrabackup] full_binary = "<absolute $SRC>/build/runtime_output_directory/xtrabackup"
125+
incremental_binary = "<absolute $SRC>/build/runtime_output_directory/xtrabackup"
126+
[workload] total_rows = <rows loaded in step 4>
127+
```
128+
129+
Sweep parameters (percents/gaps/workloads) are NEVER edited here — they
130+
are command-line flags.
131+
132+
## 7. Run the sweep (overnight at 100M rows)
133+
134+
```bash
135+
pxb-bench --workdir $SB run \
136+
--percents 5:100:5 --gaps none,0,auto,10 --workloads scattered
137+
```
138+
139+
Same densities as the original PXB-3862 chart, so cells overlay it
140+
directly; the `10` column measures what bridging buys wherever auto
141+
declines.
142+
143+
SMALL-TABLE caveat: if the table fits in the buffer pool, dirty pages
144+
never flush by eviction and the tracked set stays empty. Then drive the
145+
individual steps with a restart per density instead of `run`:
146+
147+
```bash
148+
pxb-bench --workdir $SB full-backup
149+
for pct in 5 10 15 20; do
150+
pxb-bench --workdir $SB change-data $pct --workload scattered
151+
pxb-bench --workdir $SB restart
152+
for gap in none 0 auto 10; do
153+
pxb-bench --workdir $SB inc-backup $pct $gap --workload scattered
154+
done
155+
done
156+
```
157+
158+
## 8. Send back one tarball
159+
160+
```bash
161+
cd $SB
162+
grep -h "calibrated storage\|typical gap\|request reduction" \
163+
pxb-test/logs/scattered_*_gap_auto.log > pxb-test/results/decision_lines.txt
164+
tar czf /tmp/pxb3862_results.tgz pxb-test/results/ pxb-test/logs/
165+
```
166+
167+
## 9. Predictions (split-disk, ~165us / ~1.5GB/s class storage)
168+
169+
| density | old build (÷2, budget ~125KB) | this build (÷1.5, ~160KB) |
170+
|---|---|---|
171+
| 5% | refused (correct, beats full scan) | identical |
172+
| **10%** | **refused -> 28.4s** | **bridged -> ~17s = pin-10** |
173+
| 15-100% | bridged (wins/ties) | identical |
174+
175+
On fast shared-disk NVMe the 10% verdict is expected to be the
176+
OPPOSITE (refusal, with pin-10 measurably slower) — each machine
177+
correctly for its own storage; the calibration and refusal log lines
178+
state each decision's numbers.
66 KB
Binary file not shown.

0 commit comments

Comments
 (0)