From 5f187446b942696c4e1b460faf8fba7e3a272468 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Fri, 17 Nov 2023 20:23:20 +0900 Subject: [PATCH] in_kafka: Rely on only buffer_max_size for preventing greedy consuming topics Referring Mem_Buf_Limit and relying on pause/resume should cause performance degredation. Only relying on buffer_max_size should be better to adjust flow rate. Signed-off-by: Hiroshi Hatake --- plugins/in_kafka/in_kafka.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/in_kafka/in_kafka.c b/plugins/in_kafka/in_kafka.c index 68c80e3e302..d58344676a8 100644 --- a/plugins/in_kafka/in_kafka.c +++ b/plugins/in_kafka/in_kafka.c @@ -241,11 +241,8 @@ static int in_kafka_init(struct flb_input_instance *ins, goto init_error; } - if (ctx->ins->mem_buf_limit > 0 || ctx->buffer_max_size > 0) { - if (ctx->ins->mem_buf_limit) { - ctx->polling_threshold = ctx->ins->mem_buf_limit; - } - else if (ctx->buffer_max_size > 0) { + if (ctx->buffer_max_size > 0) { + if (ctx->buffer_max_size > 0) { ctx->polling_threshold = ctx->buffer_max_size; }