Skip to content

Conversation

@kaushiksrinivas
Copy link

ProducerPerformance java application now supports synchronous blocking sends to produce messages to kafka brokers.

Till now, performance producer application supported only asynchronous sends with a callback function registered.
this would be enough when trying to load the kafka brokers without bothering much on the replication & producer responses.

But when kafka brokers replication capacity has to be loaded, asynchronous sends would not suffice.
So synchronous blocking send calls are now supported with all the existing metrics calculation of producer performance.

A boolean command line flag --synchronous-send has been added to enable/disable this feature.
Blocking .get() calls are now done upon each send, and as of this commit ResultMetadata is not being used or logged.
A new function has been introduced in the Stats class to update and get the iteration counter.

Tests done:

Comparison tests were done with and without synchronous sends.

below were the configurations of kafka cluster:
No of brokers: 3
CPU per broker: 10 cores
Memory : 32GB
Topic partitions : 1
replication factor : 3
min.insync.replicas: 1 (default).
producer acks level : 1(default), response after only leader write.

Similar configurations were given for performance producer with & without synchronous sends enabled.
It was observed that, synchronous producer was producing records approximately 5 times slower than asynchronous producer
but with guarantee of replication before subsequent sends.

So this clearly indicates the impact of replication in brokers. And these tests would help optimise resources in
kafka broker from replication performance point of view.

Attached results snapshot of performance producer run with/without synchronous send flag enabled.

@kaushiksrinivas
Copy link
Author

Asynchronous_send_summary_report.txt
Synchronous_send_summary_report.txt

added files, capturing the summary report at the end of producer run.

Copy link
Contributor

@mrsrinivas mrsrinivas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!!!

Will it be possible to continue using existing formatting?
Code seem indented with more spaces.

@kaushiksrinivas
Copy link
Author

retest this please.

@omkreddy
Copy link
Contributor

@kaushiksrinivas Thanks for the PR. Since ProducerPerformance tool is considered as public interface, we need to write small KIP.

https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Improvement+Proposals

Copy link
Contributor

@mrsrinivas mrsrinivas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address minor nits and merge conflict

percs[3]);
System.out.printf(
"%d records sent, %f records/sec (%.2f MB/sec), %.2f ms avg latency, %.2f ms max latency, %d ms 50th, %d ms 95th, %d ms 99th, %d ms 99.9th.%n",
count, recsPerSec, mbPerSec, totalLatency / (double) count, (double) maxLatency, percs[0], percs[1],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: one line per parameter for method call when statement is long acceptable.

.dest("transactionDurationMs")
.setDefault(0L)
.help("The max age of each transaction. The commitTransaction will be called after this time has elapsed. Transactions are only enabled if this value is positive.");
parser.addArgument("--topic").action(store()).required(true).type(String.class).metavar("TOPIC")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same formatting would have been nice for all places with parser.

@github-actions
Copy link

This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

@github-actions github-actions bot added the stale Stale PRs label Nov 21, 2024
@github-actions
Copy link

This PR has been closed since it has not had any activity in 120 days. If you feel like this
was a mistake, or you would like to continue working on it, please feel free to re-open the
PR and ask for a review.

@github-actions github-actions bot added the closed-stale PRs that were closed due to inactivity label Dec 22, 2024
@github-actions github-actions bot closed this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed-stale PRs that were closed due to inactivity stale Stale PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants