Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Producer performance issue and possible fix #89

Open
Parthiban-P opened this issue May 24, 2016 · 3 comments
Open

Producer performance issue and possible fix #89

Parthiban-P opened this issue May 24, 2016 · 3 comments

Comments

@Parthiban-P
Copy link

Case 1 :When we publish messages(50000) synchronously to kafka using kafka-net producer client , Throughput looks good.

var task = producer.SendMessageAsync(topic, new Message[] { kafkaMessage }); Task.WaitAll(new Task[] { task }, ts);
Case 2 : When we publish messages(50000) messages asynchronously with multiple kafka-net producer clients(5 client , 10000 msg/client synchronously) , Throughput reduces to 1/5 fold from case1.

we analysed the kafka-net Producer flow , whenever we increase producer clients ,there is some time delay in acknowledgement for every TCP request and sometimes it process the dummy acknowledgment requests ,write request waits in the queue during this time which causes the performance.

Task sendDataReady = Task.WhenAll(writeTask, _sendTaskQueue.OnHasDataAvailable(_disposeToken.Token)); Task readDataReady = Task.WhenAll(readTask, _readTaskQueue.OnHasDataAvailable(_disposeToken.Token)); Task.WaitAny(sendDataReady, readDataReady);

So , we modified the Kafka-net code to have separate thread for Write and Acknowledgment and then we ran the test case . Now Throughput(results) looks similar in both Case 1 and Case 2.

Can we have separate thread for Read and Acknowledgment , will it lead to any issue?
kindly share your thoughts .

@zoalasaurusrawr
Copy link

I'm experiencing this issue as well. When I processing data-sets asynchronously, the performance decreases significantly. Almost identical code as the gentlemen above.

@zoalasaurusrawr
Copy link

@Parthiban-P Are you using the producer code from the sample? I noticed that the using statement that disposes the client was causes this for me because I was standing up the client in a loop (embarassing because that's appdev 101). Once I created a single instance and reused it, my performance issues went away completely.

@Parthiban-P
Copy link
Author

@wmccullough : When I reuse the single Instance performance is okay , it doesn't meet for our expectation. Obviously when we use multiple instance and async request processing we should have performance improvement but its not happening here !!!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants