[英]Asynchronous Kafka Producer batch size a linger.ms
I have a question about optimizing kafka asynchronous producer Throughput: the configuration batch.size and linger.ms have an effect when using asynchronous producer?我有一个关于优化kafka异步生产者吞吐量的问题:配置batch.size和linger.ms在使用异步生产者时有影响吗?
I am asking because I think that those parameters will only impact synchronous producer because it will wait for broker acknowledgment.In case of asynchronous producer, this will not have impact?我问是因为我认为这些参数只会影响同步生产者,因为它将等待代理确认。如果是异步生产者,这不会有影响吗?
Also, is there any configuration parameter that can optimize asynchronous producer?另外,有没有可以优化异步生产者的配置参数?
Both the properties have impact on asynchronous Kafka Producer:这两个属性都对异步 Kafka Producer 有影响:
linger.ms-> This instruct the producer upto this configured value(ex:2 millisecond) if batch size is not fill up. There will be latency of 2 ms in case message flow is low.
batch.size -> Message buffer size that will be send in single request. Higher batch size also request more memory (buffer.memory)
acks=all , Slowest but most durable configuration, wait for acknowledgement of all message sent.
For details, You can go through Kafka document: https://kafka.apache.org/23/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html具体可以go通过Kafka文档: https://kafka.apache.org/23/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.