简体   繁体   中英

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?

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM