ksqlDB - 如何为生产者设置 batch.size 和 linger.ms 以优化压缩

ksqlDB - How to set batch.size and linger.ms for producers to optimise compression

配置 ksqlDB 时,我可以设置选项 ksql.streams.producer.compression.type,为 ksqlDB 的内部生产者启用压缩。因此,当我创建一个 ksqlDB 流时,它的输出主题将使用选定的压缩类型进行压缩。

但是,据我所知,压缩性能在很大程度上受到生产者批处理量的影响。因此,我希望能够为 ksqlDB 的生产者配置 batch.size and linger.ms 参数。有谁知道是否以及如何为 ksqlDB 设置这些参数?

感谢 Matthias J Sax 在 Confluent Community Slack 频道上回答我的问题:https://app.slack.com/client/T47H7EWH0/threads?cdn_fallback=1

文档中有一个info-box。 这很好地解释了它:

KSQL documentation info box

The underlying producer and consumer clients in ksqlDB's server can be modified with any valid properties. Simply use the form ksql.streams.producer.xxx, ksql.streams.consumer.xxx to pass the property through. For example, ksql.streams.producer.compression.type sets the compression type on the producer.

来源:https://docs.ksqldb.io/en/latest/reference/server-configuration/