confluent-kafka-dotnet icon indicating copy to clipboard operation
confluent-kafka-dotnet copied to clipboard

LingerMs default is 0 or 5?

Open NickLydon opened this issue 2 years ago • 2 comments

Description

The comment for ProducerConfig.LingerMs says that the default is 5, whereas the confluent docs say it's 0. Is this a typo or does the dotnet client actually supply different defaults?

NickLydon avatar Jun 08 '22 10:06 NickLydon

those docs are for the java client.

in librdkafka (and the dotnet client), the default is 5ms. https://github.com/edenhill/librdkafka/blob/master/src/rdkafka_conf.c#L1326

5ms is a better general purpose default setting which is good for a very wide range of scenarios. you would only want 0ms for low throughput applications where latency is critical (you will get better latency in higher throughput scenarios with a non-zero linger.ms).

mhowlett avatar Jun 09 '22 14:06 mhowlett

Thanks for the reply. If we're using ProduceAsync (albeit with concurrent calls to it) are we also getting the benefit of LingerMs? Or would we have to use Produce?

NickLydon avatar Jun 09 '22 19:06 NickLydon

ProduceAsync and Produce are both thin layers on top of the same librdkafka capability. Applies to both.

mhowlett avatar Oct 03 '22 16:10 mhowlett