【发布时间】:2019-02-15 22:36:16
【问题描述】:
我正在寻找 Kafka Streams 的一些融合示例,配置值“StreamsConfig.COMMIT_INTERVAL_MS_CONFIG”的不同值让我有点困惑。
例如,在微服务示例中,
config.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 1); //commit as fast as possible
另一个,
// Records should be flushed every 10 seconds. This is less than the
default
// in order to keep this example interactive.
streamsConfiguration.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 10 *
1000);
另一个,
// Set the commit interval to 500ms so that any changes are flushed
frequently and the top five
// charts are updated with low latency.
streamsConfiguration.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG,
500);
在示例中的时间间隔从 1ms 变为 10000ms,我真正感兴趣的是系统中的 1ms 一直很重负载,去 1ms Commit Interval 会不会很危险?
谢谢解答..
【问题讨论】:
-
如果您没有特定原因,请使用默认值 30 秒。提交意味着一定的开销,如果提交过于频繁,您可能会扼杀吞吐量——示例不显示配置,建议用于生产。