From ead43bc08d293743b8521938c95014b0a0f1d838 Mon Sep 17 00:00:00 2001 From: Jason Andrews Date: Mon, 30 Jun 2025 11:18:44 -0500 Subject: [PATCH] review BOLT Learning Path --- .../bolt-merge/how-to-2.md | 17 +++++++++-------- .../bolt-merge/how-to-3.md | 4 +++- .../bolt-merge/how-to-4.md | 15 +++++++++++---- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-2.md b/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-2.md index 84263e88de..69a7b05852 100644 --- a/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-2.md +++ b/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-2.md @@ -141,7 +141,14 @@ Adjust `--datadir`, `--socket`, and `--port` as needed for your environment. Mak With the database running, open a second terminal to create a benchmark User and third terminal to run the client commands. +In the new terminal, navigate to the build directory: + +```bash +cd $HOME/mysql-server/build +``` + ## Create Benchmark User and Database + Run once after initializing MySQL for the first time: ```bash bin/mysql -u root <<< " @@ -163,7 +170,7 @@ bin/mysql -u root <<< "DROP DATABASE bench; CREATE DATABASE bench;" ## Install and build sysbench -In the third terminal, do the below if you do not have sysbench already. +In a third terminal, run the commands below if you have not run sysbench yet. ```bash git clone https://github.com/akopytov/sysbench.git @@ -194,12 +201,6 @@ Run `sysbench` with the `prepare` option: src/lua/oltp_read_write.lua prepare ``` -Navigate out of the `sysbench` directory. - -```bash -cd .. -``` - ## Shutdown MySQL and snapshot dataset for fast reuse Do these steps once at the start from MySQL source directory @@ -282,7 +283,7 @@ The `.fdata` file defined in `--instrumentation-file` will be populated with run After completing each benchmark run (e.g. after sysbench run), you must cleanly shut down the MySQL server and reset the dataset to ensure the next test starts from a consistent state. ```bash -bin/mysqladmin -u root shutdown ; rm -rf /dev/shm/dataset ; cp -R data-orig/ /dev/shm/dataset +bin/mysqladmin -u root shutdown ; rm -rf /dev/shm/dataset ; cp -R data/ /dev/shm/dataset ``` ## Verify the profile was created diff --git a/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-3.md b/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-3.md index 4bfcb1d378..0e739accc7 100644 --- a/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-3.md +++ b/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-3.md @@ -24,6 +24,8 @@ llvm-bolt $HOME/mysql-server/build/bin/mysqld \ 2>&1 | tee $HOME/mysql-server/bolt-instrumentation-writeonly.log ``` +Run sysbench again with the write-only workload: + ```bash # On an 8-core system, use available cores (e.g., 7 for sysbench) taskset -c 7 ./src/sysbench \ @@ -52,7 +54,7 @@ Make sure that the `--instrumentation-file` is set appropriately to save `profil After completing each benchmark run (e.g. after sysbench run), you must cleanly shut down the MySQL server and reset the dataset to ensure the next test starts from a consistent state. ```bash -./build/bin/mysqladmin -u root shutdown ; rm -rf /dev/shm/dataset ; cp -R data-orig/ /dev/shm/dataset +./bin/mysqladmin -u root shutdown ; rm -rf /dev/shm/dataset ; cp -R data/ /dev/shm/dataset ``` ### Verify the Second Profile Was Generated diff --git a/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-4.md b/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-4.md index 37087bd571..65da71ece2 100644 --- a/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-4.md +++ b/content/learning-paths/servers-and-cloud-computing/bolt-merge/how-to-4.md @@ -23,7 +23,7 @@ make install Use `llvm-bolt` to instrument `libssl.so.3`: ```bash -llvm-bolt $HOME/bolt-libs/openssl/libssl.so.3 \ +llvm-bolt $HOME/bolt-libs/openssl/lib/libssl.so.3 \ -instrument \ -o $HOME/bolt-libs/openssl/lib/libssl.so.3.instrumented \ --instrumentation-file=$HOME/bolt-libs/openssl/lib/libssl-readwrite.fdata \ @@ -65,10 +65,14 @@ cp $HOME/bolt-libs/openssl/libssl.so.optimized $HOME/bolt-libs/openssl/libssl.so export LD_LIBRARY_PATH=$HOME/bolt-libs/openssl/lib # You can confirm that mysqld is loading your optimized library with: -LD_LIBRARY_PATH=$HOME/bolt-libs/openssl/ ldd build/bin/mysqld | grep libssl +LD_LIBRARY_PATH=$HOME/bolt-libs/openssl/ +ldd build/bin/mysqld | grep libssl +``` It should show: -libssl.so.3 => /home/ubuntu/bolt-libs/openssl/libssl.so.3 (...) + +```output +libssl.so.3 => /home/ubuntu/bolt-libs/openssl/libssl.so.3 ``` This ensures MySQL will dynamically load the optimized `libssl.so`. @@ -148,9 +152,12 @@ export LD_LIBRARY_PATH=$HOME/bolt-libs/openssl/ # You can confirm that mysqld is loading your optimized library with: LD_LIBRARY_PATH=$HOME/bolt-libs/openssl/ ldd build/bin/mysqld | grep libcrypto +``` It should show: -libcrypto.so.3 => /home/ubuntu/bolt-libs/openssl/libcrypto.so.3 (...) + +```output +libcrypto.so.3 => /home/ubuntu/bolt-libs/openssl/libcrypto.so.3 ``` Run a final validation workload to ensure functionality and measure performance improvements.