Openflow Connector for Kafkaのパフォーマンスチューニング

注釈

このコネクタは、 Snowflakeコネクタ規約 に従うものとします。

このトピックでは、 Kafka用Snowflake Openflowコネクタ のパフォーマンスを最適化し、Snowflakeへのデータ取り込み時に最適なスループットを達成し、レイテンシを最小限に抑えるためのガイダンスを提供します。

パフォーマンスの考慮事項

最適なパフォーマンスが得られるようにOpenflow Connector for Kafkaを構成する場合、取り込みのスループットとレイテンシに影響する以下の主な要因を考慮します。

Kafkaの構成

パーティション数

More partitions allow for higher parallelism but require careful coordination with consumer configuration. Excessive partitions can cause several issues: increased memory usage, slower leader elections during failures, and significant metadata management overhead on brokers.

圧縮

メッセージ圧縮はネットワーク帯域幅を削減できますが、 CPU オーバーヘッドが増加します。

フローファイルの最適化

フローファイルのサイズ

パフォーマンスを最適化するには、フローファイルに個々の小さなメッセージを含めるのではなく、1~10 MB の範囲にします。より大きなフローファイルは、処理のオーバーヘッドを削減し、個々のファイル操作の数を最小限に抑えることでスループットを向上させます。デフォルト設定では、許容範囲内のサイズのフローファイルが得られるはずです。スループットが低いと、小さなフローファイルが予想されます。

If you observe small flowfiles with high throughput, contact Snowflake Support for assistance.

ネットワークとインフラ

ネットワークレイテンシ

Lower latency between Kafka brokers and Openflow improves overall performance. Snowflake recommends deploying Kafka brokers and Openflow in the same CSP region.

推奨ノードサイズ

The following table provides configuration recommendations based on expected workload characteristics:

ノードサイズ

推奨されるケース

メッセージレート容量

小(S)

低~中レベルのスループットシナリオ

Up to 18 MB/s per node

中(M)

中~高レベルのスループットシナリオ

Up to 145 MB/s per node

大(L)

高レベルのスループットシナリオ

Up to 250 MB/s per node

パフォーマンス最適化のベストプラクティス

プロセッサーの並行タスクの調整

To optimize processor performance, you can adjust the number of concurrent tasks for both ConsumeKafka and PublishSnowpipeStreaming processors. Concurrent tasks allow processors to run multiple threads simultaneously, improving throughput for high-volume scenarios.

プロセッサーの並行タスクを調整するには、以下のタスクを実行します。

  1. Openflowキャンバスでプロセッサーを右クリックします。

  2. Select Configure from the context menu.

  3. Navigate to the Scheduling tab.

  4. In the Concurrent tasks field, enter the preferred number of concurrent tasks.

  5. Select Apply to save the configuration.

重要な考慮事項

メモリ使用状況

各並行タスクは追加のメモリを消費します。並行タスクの増加時に JVM のヒープ使用状況を監視します。

Kafkaパーティション

For ConsumeKafka, the number of concurrent tasks multiplied by the number of runtime nodes should not exceed the number of total Kafka partitions from all topics.

控えめにスタートする

低い値から始め、パフォーマンスメトリックを監視しながら徐々に上げていきます。

Troubleshooting performance issues: Common performance bottlenecks

高いコンシューマーの遅延またはSnowflake取り込みのボトルネック

Kafkaコンシューマーの遅延が増大している場合、またはSnowflake取り込みが遅い場合は、以下のタスクを実行します。

  1. OpenflowとKafkaブローカー間のネットワーク接続と帯域幅を確認します。

  2. Observe if the queue in front of the PublishSnowpipeStreaming processor increases.

    1. If yes, consider adding more concurrent tasks for the PublishSnowpipeStreaming processor in the range limitations provided in 並行タスクの推奨設定.

    2. If not, consider adding more concurrent tasks for the ConsumeKafka processor in the range limitations provided in 並行タスクの推奨設定.

  3. より大きなノードタイプの使用を検討します。

  4. ランタイムの最大ノード数を増やすことを検討します。

メモリ圧力

メモリ関連の問題が発生した場合:

  1. Reduce the batch sizes to lower the memory footprint.

  2. ConsumeKafka プロセッサーの並行タスク数を減らします。

  3. より大きなノードタイプへのアップグレードを検討します。

ネットワークレイテンシの問題

レイテンシが大きい場合:

  1. Openflowと外部システム間のネットワーク構成を確認します。

  2. Kafkaクラスターの近くにOpenflowをデプロイすることを検討します。

  3. If working with low throughput, consider lowering the Client Lag settings in the PublishSnowpipeStreaming processor and Max Uncommitted Time in the ConsumeKafka processor.