Skip to content

Commit 06fe4ac

Browse files
Fixed heading sizes
1 parent ca1ff62 commit 06fe4ac

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ llvm-bolt $HOME/mysql-server/build/bin/mysqld \
249249
2>&1 | tee $HOME/mysql-server/bolt-instrumentation-readonly.log
250250
```
251251

252-
### Explanation of key options
252+
## Explanation of key options
253253

254254
These flags control how BOLT collects runtime data from the instrumented binary. Understanding them helps ensure accurate and comprehensive profile generation:
255255

content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-3.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@ After running each benchmark, cleanly shut down the MySQL server and reset the i
6464
```bash
6565
./bin/mysqladmin -u root shutdown ; rm -rf /dev/shm/dataset ; cp -R data/ /dev/shm/dataset
6666
```
67-
### Verify that both profiles exist
67+
## Verify that both profiles exist
6868

6969
Verify that the following `.fdata` files have been generated:
7070

7171
```bash
7272
ls -lh $HOME/mysql-server/build/profile-readonly.fdata
7373
ls -lh $HOME/mysql-server/build/profile-writeonly.fdata
7474
```
75-
### Merge the read and write profiles
75+
## Merge the read and write profiles
7676

7777
Both `.fdata` files should now exist and contain valid data:
7878

7979
- `profile-readonly.fdata`
8080
- `profile-writeonly.fdata`
8181

82-
### Merge the feature profiles
82+
## Merge the feature profiles
8383

8484
Use `merge-fdata` to combine the feature-specific profiles into one comprehensive `.fdata` file:
8585

@@ -97,15 +97,15 @@ Profile from 2 files merged.
9797

9898
This creates a single merged profile (`profile-merged.fdata`) covering both read-only and write-only workload behaviors.
9999

100-
### Verify the merged profile
100+
## Verify the merged profile
101101

102102
Confirm the merged profile file exists and is non-empty:
103103

104104
```bash
105105
ls -lh $HOME/mysql-server/build/profile-merged.fdata
106106
```
107107

108-
### Optimize the binary with the merged profile
108+
## Optimize the binary with the merged profile
109109

110110
Use LLVM-BOLT to generate the final optimized binary using the merged `.fdata` file:
111111

content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-4.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ layout: learningpathall
1010

1111
In this section, you'll learn how to instrument and optimize shared libraries, and specifically, `libssl.so` and `libcrypto.so` using BOLT. These libraries are used by MySQL, and optimizing them can improve overall performance. You'll rebuild OpenSSL from source to include symbol information, then collect profiles and apply BOLT optimizations.
1212

13-
## Instrument Shared Libraries
14-
15-
### Prepare instrumentable versions
13+
## Prepare instrumentable versions
1614

1715
If system libraries like `/usr/lib/libssl.so` are stripped, rebuild OpenSSL from source with relocations:
1816

@@ -25,7 +23,7 @@ make -j$(nproc)
2523
make install
2624
```
2725

28-
### Instrument libssl.so
26+
## Instrument libssl.so
2927

3028
Use `llvm-bolt` to instrument `libssl.so.3`:
3129

@@ -42,7 +40,7 @@ llvm-bolt $HOME/bolt-libs/openssl/lib/libssl.so.3 \
4240

4341
Launch MySQL with the instrumented `libssl.so` and run a read+write Sysbench test to populate the profile
4442

45-
### Optimize libssl using the profile
43+
## Optimize libssl using the profile
4644

4745
After running the read+write test, ensure `libssl-readwrite.fdata` is populated.
4846

@@ -62,7 +60,7 @@ llvm-bolt $HOME/bolt-libs/openssl/lib/libssl.so.3 \
6260
2>&1 | tee $HOME/mysql-server/build/bolt-libssl.log
6361
```
6462

65-
### Replace the library at runtime
63+
## Replace the library at runtime
6664

6765
Copy the optimized version over the original and export the path:
6866

@@ -88,7 +86,7 @@ libssl.so.3 => /home/ubuntu/bolt-libs/openssl/libssl.so.3
8886

8987
This ensures MySQL will dynamically load the optimized `libssl.so`.
9088

91-
### Run the final workload and validate performance
89+
## Run the final workload and validate performance
9290

9391
Start the BOLT-optimized MySQL binary and link it against the optimized `libssl.so`. Run the combined workload:
9492

@@ -119,11 +117,11 @@ taskset -c 7 ./src/sysbench \
119117

120118
In the next step, you'll optimize an additional critical external library (`libcrypto.so`) using BOLT, following a similar process as `libssl.so`. Afterward, you'll interpret performance results to validate and compare optimizations across baseline and merged scenarios.
121119

122-
### Optimize libcrypto.so with BOLT
120+
## Optimize libcrypto.so with BOLT
123121

124122
Follow these steps to instrument and optimize `libcrypto.so`:
125123

126-
### Instrument libcrypto.so
124+
## Instrument libcrypto.so
127125

128126
```bash
129127
llvm-bolt $HOME/bolt-libs/openssl/libcrypto.so.3 \
@@ -137,7 +135,7 @@ llvm-bolt $HOME/bolt-libs/openssl/libcrypto.so.3 \
137135
```
138136
Launch MySQL using the instrumented shared library and run a read+write Sysbench test to populate the profile.
139137

140-
### Optimize libcrypto using the profile
138+
## Optimize libcrypto using the profile
141139
After running the read+write test, ensure `libcrypto-readwrite.fdata` is populated.
142140

143141
Run BOLT on the uninstrumented libcrypto.so using the collected read+write profile to generate an optimized library:

content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-5.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This section compares the performance of baseline binaries with BOLT-optimized v
1212

1313
All tests used Sysbench with the flags `--time=0 --events=10000`. This configuration ensures that each test completes exactly 10,000 requests per thread, delivering consistent workload runtimes across runs.
1414

15-
### Baseline performance (without BOLT)
15+
## Baseline performance (without BOLT)
1616

1717
| Metric |Read-only | Write-only | Read + write |
1818
|---------------------------|----------------------|------------------------|------------------------|
@@ -22,7 +22,7 @@ All tests used Sysbench with the flags `--time=0 --events=10000`. This configura
2222
| Latency 95th % (ms) | 1.04 | 0.83 | 1.79 |
2323
| Total time (s) | 9.93 | 4.73 | 15.40 |
2424

25-
### Performance comparison: merged and non-merged instrumentation
25+
## Performance comparison: merged and non-merged instrumentation
2626

2727
| Metric | Regular BOLT (read + write, system libssl) | Merged BOLT (read + write + libssl) |
2828
|---------------------------|---------------------------------------------|-------------------------------------------------|
@@ -42,7 +42,7 @@ Second test run:
4242
| Latency 95th % (ms) | 1.39 | 1.37 |
4343
| Total time (s) | 239.9 | 239.9 |
4444

45-
### Performance across BOLT optimizations
45+
## Performance across BOLT optimizations
4646

4747
| Metric | BOLT read-only | BOLT write-only | Merged BOLT (read + write + libssl) | Merged BOLT (read + write + libcrypto) | Merged BOLT (read + write + libcrypto + libssl) |
4848
|---------------------------|---------------------|-------------------|----------------------------------|------------------------------------|-------------------------------------------|
@@ -56,13 +56,13 @@ Second test run:
5656
All Sysbench and .fdata file paths, as well as taskset usage, should match the conventions in previous steps: use Sysbench from PATH (no src/), use /usr/share/sysbench/ for Lua scripts, and use $HOME-based paths for all .fdata and library files. On an 8-core system, use taskset -c 7 for Sysbench and avoid contention with mysqld.
5757
{{% /notice %}}
5858

59-
### Key metrics to analyze
59+
## Key metrics to analyze
6060

6161
- **TPS (transactions per second)** – higher is better
6262
- **QPS (queries per second)** – higher is better
6363
- **Latency (average and 95th percentile)** – lower is better
6464

65-
### Conclusion
65+
## Conclusion
6666

6767
- BOLT-optimized binaries clearly outperform baseline versions by improving instruction cache usage and shortening execution paths.
6868
- Merging feature-specific profiles does not negatively affect performance. Instead, they allow better tuning for varied real-world workloads by capturing a broader set of runtime behaviors.

0 commit comments

Comments
 (0)