-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Kafka output plugin should support batching at the producer level #4161
Comments
see also #2825 |
@russorat Is there code for this in 1.8 that we could give a look at? I was just talking with @edbernier |
@JimHagan I have two potential patches that I could use your help performance testing, if you are up for it. I have them in separate branches: The send-messages branch works by simply using the The other method combines There is a potential issue you may run into when using the master branch where Telegraf could deadlock shutting down, I will of course take care of this before the next release. |
I will get back to you @danielnelson I believe we want the second and the reason is we are using Kafka mirror maker to move large amounts of metrics to and from data centers and that should provide optimizations for what we are doing. I want to check in with one of our Kafka experts. The only concern about the batching option is it looks like it attempts to send the whole buffer's worht of data as a batch. Am I reading that correctly? The idea I had was that we could constrain the number of messages that would be bundled per batch. I can certain test the version as is for now but we could run into the kafka max message size on our infrastructure (as it's configured). |
@danielnelson and @edbernier After consulting with Tom, he indicated that the first option ( |
The producer should be able to send the data efficiently using SendMessages, in my testing it is faster than sending with batching but I don't have a high traffic test environment. You can control the size of the batches using the I think we shouldn't merge the batching support pending benchmarks showing that it is needed, if you are available to help check this I could provide a development build. |
@danielnelson Should I be getting an RC to test this with? |
I added links on #4517, let me know if you need a different package. |
Support Batching at the Producer Level
This will make it possible to scale to higher degree, by making fewer calls and may allow our compression of output objects to be more efficient.
Proposal:
Currently the
Write
method uses an individual call to sendMessage per metric. This could be refactored to allow for a batch paramter passed to write (and injected down from the Kafka output plugin). We could usesendMessages
instead.Suggestion...
Use case: [Why is this important (helps with prioritizing requests)]
We have a very large multi-data center Kafka pipeline and we need batching to lower the number of calls as well as to make Kafka compression possibly more efficient.
The text was updated successfully, but these errors were encountered: