Repository navigation
[ISSUE #12706]✨Add an opt-in x86-64 level build argument for the Broker in the service image - #12707
Merged
Merged
Conversation
…er in the service image
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
Adds an opt-in build argument that builds the Broker for a newer x86-64 microarchitecture level. The default stays the toolchain baseline, so the published images do not change.
docker/Dockerfile.base(service-builderstage):ARG ROCKETMQ_BROKER_TARGET_CPU=, next toROCKETMQ_BROKER_PGOandROCKETMQ_BROKER_BOLT.x86-64-v2,x86-64-v3orx86-64-v4add-C target-cpu=<level>to the Broker build: both PGO builds, and the plain build when PGO is off. Empty keeps the baseline; any other value, such as the non-portablenative, fails the build with a message.librocksdb-sysin the Controller does not compile with-C target-cpu=x86-64-v3alone: its build script then enables the CRC32C path that needs PCLMUL, which that level does not include. A real image build found this.rocketmq-website/docs/deployment/containers.mdand its zh-CN translation: the argument, its hardware requirement (AVX2, BMI2 and FMA: Intel Haswell, AMD Zen or newer) and the measured effect.A separate
x86-64-v3image in the publish pipeline is not added: about 2% to 5% of Broker CPU does not justify building and maintaining a second image. A Broker built forx86-64-v3stops with an illegal-instruction error on older CPUs.How Did You Test This Change?
origin/mainarchive with this Dockerfile (docker buildx build --target service-builder):--build-arg ROCKETMQ_BROKER_TARGET_CPU=nativefails at once withROCKETMQ_BROKER_TARGET_CPU must be empty, x86-64-v2, x86-64-v3 or x86-64-v4.--build-arg ROCKETMQ_BROKER_TARGET_CPU=x86-64-v3with the default PGO and BOLT builds all four services. In the result the Broker has about 200k AVXymminstructions (the baseline Broker about 30k, from runtime-dispatched code), the other services stay at the baseline, androcketmq-broker-rust --helpruns.npm run buildinrocketmq-website: both locales build and render the new text.x86-64-v3as well added nothing.🤖 Generated with Claude Code