Repository navigation
[ISSUE #12672]✨Lay out the release Broker with BOLT after PGO - #12673
Merged
Merged
Conversation
Collaborator
|
🔊@mxsm 🚀Thanks for your contribution🎉! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes(Closes)
Brief Description
The release Broker built by
docker/Dockerfile.baseis now laid out with BOLT after PGO.builder-baseinstallsbolt-19from the pinned Debian snapshot.ROCKETMQ_BROKER_PGO=true, both PGO stages use v0 symbol names: BOLT 19 reads legacy names that contain..coldas split function fragments, and the PGO profile must name functions the way the final build does. The final build also links with--emit-relocs.llvm-bolt -instrument, trained by the existing loopback script, and rewritten from the merged profile (-reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions -split-all-cold -split-eh -icf=1 -use-gnu-stack). Instrumentation is used because a build container cannot record hardware branch samples. The tools are started from/usr/lib/llvm-19/bin:llvm-boltlooks for its instrumentation runtime next to the directory it runs from, and Debian installs it under the LLVM prefix rather than next to/usr/bin/llvm-bolt-19.scripts/pgo-train-broker.shacceptsROCKETMQ_TRAINING_PROFILE_GLOB(default*.profraw) so the same training drives both instrumentations.ROCKETMQ_BROKER_BOLT(defaulttrue, effective with PGO) keeps the PGO-only binary when set tofalse.scripts/README.mddescribe the step and the switches.The Broker binary grows from about 40 MB to about 59 MB: BOLT keeps the original text section, and v0 names are longer.
How Did You Test This Change?
docker buildx build --target service-builderof this tree (clean export, cold target cache): PGO training 22 s, BOLT instrumentation, BOLT training 22 s,merge-fdata, rewrite with 5,473 of 35,123 functions profiled, and the BOLT binary installed as the Broker. The first runs of this build caught two Debian-specific issues that container tests did not: the/usr/bin/llvm-bolt-19link cannot find the instrumentation runtime, andllvm-boltdoes not create its output directory.docker buildx build --target broker: image 199 MB, Broker binary 58.9 MB. The image's Broker served sync, single-connection and four-connection async runs with 0 failures, and matched the container-built PGO+BOLT binary (async 95.9k vs 95.6k msg/s, user cycles 166.4k vs 166.4k per message).User cycles fell in every set; throughput moved within about 3% between sets.
bash -n scripts/pgo-train-broker.sh.🤖 Generated with Claude Code