opensource4you / astraea

釋放kafka的無限潛能
Apache License 2.0
125 stars 45 forks source link

[ASSIGNOR] 調查端對端延遲過高原因 #1774

Open harryteng9527 opened 1 year ago

harryteng9527 commented 1 year ago

related https://github.com/skiptests/astraea/pull/1524#issuecomment-1559351373

此 issue 拿來討論實驗中使用 Cost-Aware assignor 的 consumers 端對端延遲有時候會到 20 多秒

Partition Lag

下圖 partition lag 的圖是抓 Kafka consumer 紀錄的 Lag 所繪製的圖 partitionLAg

上面 partition lag 的圖中,使用 Cost-Aware assignor 的 consumers 會追不上兩個 partitions 的 Lag,而使用 Range assignor 的 consumers 追不上的 partitions 數量更多

我去看了一下 Cost-Aware 中 consumers 的端對端延遲,看到被分配到這兩個 partitions 的 consumer 的端對端延遲有時會特別高(下圖的 Consumer[1] 70) Consumers 的端對端延遲

看它(Consumer[1] 70)的分配沒有被流入速率低的 partition 影響,但被分配的 cost 是最重的,比平均高 50 MiB,所以可能是來不及處理導致資料一直堆積,產生過高的 e2e latency

chia7712 commented 1 year ago

所以可能是來不及處理導致資料一直堆積,產生過高的 e2e latency

這句話講的是結果而不是原因,可否試著分析一下為何會有如此的落差?如果一開始資料寫入就很平衡的話,還會有如此落差嗎?