Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ with each codec, the ZLIB ones finished streams.

A first round of benchmarks, and a baseline against Java's V5 client on a 5.0.1 broker ([8](docs/8-quality.md) §6):
micro-benchmarks of the producer's state machine and of the codecs, and `tools/perf`, which measures the producer's and
the Queue consumer's throughput and latency against a broker as Java's `pulsar-perf` does. The producer is bound by
its own CPU, most of a send's spent outside the state machine, and the thread-safe consumer's receives and acks each
cross threads: the next rounds look for where a send's time goes, and measure loops.
the Queue consumer's throughput and latency against a broker as Java's `pulsar-perf` does. The client side, the
producer and `perf` driving it, is bound by its CPU, most of a send's spent outside the state machine, and the
thread-safe consumer's receives and acks each cross threads: the next rounds look for where a send's time goes, and
measure loops.

## M7: Conformance and a first release

Expand Down
10 changes: 5 additions & 5 deletions docs/8-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ reaches, 1 KiB messages of uppercase letters, batches of up to 1 ms, one segment

What it shows:

- **The producer is bound by its own CPU.** In a separate 1 KiB run, sampled with `docker stats`, this client used
150–180% of a core, its loop's thread and the one making the load, for about 500k msg/s, and 100% on the local
client, both on one thread, for about 400k. Java's used under one core for about 990k, and the broker had room every
time. The state machine takes under 0.3 µs of a message, the micro-benchmarks say, out of about 3 µs of CPU in all:
the next round looks for where the rest goes.
- **The client side is bound by its CPU, the producer and `perf` driving it.** In a separate 1 KiB run, sampled with
`docker stats`, this client used 150–180% of a core, its loop's thread and the one making the load, for about 500k
msg/s, and 100% on the local client, both on one thread, for about 400k. Java's used under one core for about 990k,
and the broker had room every time. The state machine takes under 0.3 µs of a message, the micro-benchmarks say,
out of about 3 µs of CPU in all, `perf`'s share included: the next round looks for where the rest goes.
- **Large messages are bound by the broker:** at 10 KiB both clients store about 1 GB/s.
- **At a fixed rate, the latencies match**, this client's a little lower.
- **The thread-safe consumer's receives and acks each cross to its loop's thread**, so a loop receiving and
Expand Down
15 changes: 13 additions & 2 deletions tools/perf/baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,23 @@ topic() {
echo "topic://public/default/$name"
}

# The summary lines a tool prints at the end of a run. A run that ends without them stops the script, after the last
# lines the tool printed.
summary() {
local out
out=$(cat)
grep -o 'Aggregated.*' <<<"$out" && return
tail -n 20 <<<"$out" >&2
echo "baseline.sh: the run ended without its summary line" >&2
return 1
}

rust() {
docker run --rm --network "$NET" -v "$BIN:/perf:ro" "$RUST_IMAGE" /perf/perf "$@" 2>&1 | grep -o 'Aggregated.*'
docker run --rm --network "$NET" -v "$BIN:/perf:ro" "$RUST_IMAGE" /perf/perf "$@" 2>&1 | summary
}

java() {
docker run --rm --network "$NET" "$IMAGE" bin/pulsar-perf "$@" 2>&1 | grep -o 'Aggregated.*'
docker run --rm --network "$NET" "$IMAGE" bin/pulsar-perf "$@" 2>&1 | summary
}

# The rate over a run of `$1` seconds, from the records its summary line counts.
Expand Down
Loading