[improve][test] Create the IoT gateways' producers concurrently in a random order - #26827
Merged
lhotari merged 2 commits intoOct 4, 2026
Merged
Conversation
…random order Assisted-by: Claude Code (claude-opus-5-5)
dao-jun
approved these changes
Oct 4, 2026
11 tasks
…eways-concurrent # Conflicts: # tests/performance/tools/src/main/java/org/apache/pulsar/tests/performance/tools/IotScenario.java
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.
Motivation
In the Pulsar Performance Testing Framework's high-rate and max-rate IoT telemetry scenarios, the gateways precreate their producers one at a time, in the order of the gateways. Each gateway has a Pulsar client of its own, which first connects to the service URL for its lookup and then to the topic's broker. In the test cluster, the service URL and the topics' owner are the same broker.
So the broker accepted the gateways' connections in strict alternation: a lookup connection, then a data connection, and so on. The broker assigns the connections that it accepts to its I/O threads in turn, so every data connection landed on every other I/O thread:
numIOThreads(32 on the test host), 16 of the 32 I/O threads served all the traffic, and the other 16 were idle at about 1 %.Real gateways connect independently and many at the same time, for example when they reconnect after a broker restart. The measurements therefore came from a connection layout that real clients don't produce.
Modifications
gateways.producer.precreateConcurrency(32): withprecreate: true, the gateways create their producers in a random order, up to that many at a time. The order is the same for every run of a scenario.precreateConcurrency: 1creates them one at a time in the order of the gateways, as before. It reproduces runs made before this change.precreate: false) still creates producers one at a time.Measurements
The
iot-telemetry-max-ratescenario at 128 B: 500 gateways publish unbatched messages to one topic without a rate limit, with up to 100,000 in flight, and 20 consumers receive them.numIOThreads32 (the default on this host) or 8 (the default that [improve][broker] Default numIOThreads to half the available processors, at least 8 #26825 proposes), run twice, interleaved./procfor 15 s of each measurement.numIOThreads32: I/O threads above 5 % of a corenumIOThreads32: throughputnumIOThreads32: broker CPU per million messagesnumIOThreads8: I/O threads above 5 % of a corenumIOThreads8: throughputnumIOThreads8: broker CPU per million messagesprecreateConcurrency: 1to compare with runs made before this change.The broker's I/O threads, numIOThreads 32
The broker's I/O threads, numIOThreads 8
Throughput, numIOThreads 32: one at a time (A, before) and concurrent (B, this change), with the same axes
Verifying this change
This change added tests and can be verified as follows:
TelemetryProducerTest:precreateConcurrencycreations at a time; no new creations after a failure; every started creation completes before the first failure is thrown.IotScenarioTestchecks thatprecreateConcurrencybelow 1 is rejected and that an omitted one is 32.ScenarioFilesTestresolves the scenarios with the new setting.Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
This change was prepared with the assistance of Claude Code (claude-opus-5-5); I have reviewed and verified it.