Приемник консоли Kafka ОШИБКА "Сбой фиксации раздела" - PullRequest
0 голосов
/ 02 мая 2018

Я использую kafka-console-consumer для изучения темы кафки.

Периодически я получаю это сообщение об ошибке, за которым следуют 2 предупреждения:

[2018-05-01 18:14:38,888] ERROR [Consumer clientId=consumer-1, groupId=console-consumer-56648] Offset commit failed on partition my-topic-0 at offset 444: The coordinator is not aware of this member. (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)

[2018-05-01 18:14:38,888] WARN [Consumer clientId=consumer-1, groupId=console-consumer-56648] Asynchronous auto-commit of offsets {my-topic-0=OffsetAndMetadata{offset=444, metadata=''}} failed: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records. (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)

[2018-05-01 18:14:38,888] WARN [Consumer clientId=consumer-1, groupId=console-consumer-56648] Synchronous auto-commit of offsets {my-topic-0=OffsetAndMetadata{offset=447, metadata=''}} failed: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records. (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)

В журналах предупреждений предлагается:

Это означает, что время между последующими вызовами poll () было больше, чем настроенный max.poll.interval.ms, что обычно означает, что цикл опроса тратит слишком много времени на обработку сообщений. Вы можете решить эту проблему, увеличив тайм-аут сеанса или уменьшив максимальный размер пакетов, возвращаемых в poll () с max.poll.records.

Итак, мне нужно либо увеличить max.poll.interval.ms, либо уменьшить max.poll.records.

Пожалуйста, сообщите, каковы будут последствия каждого метода и какой предпочтителен в другой ситуации?

1 Ответ

0 голосов
/ 06 июля 2018

Если вы увеличите max.poll.interval.ms с надписью «можно потратить время на обработку большого пакета записей» и вы получите пропускную способность, если сможете обрабатывать большие партии более эффективно, чем меньшие.

Для уменьшения max.poll.records говорит: «бери меньше записей, чтобы было достаточно времени для их обработки», и предпочел бы задержку перед пропускной способностью.

Также учтите, что оба настроены нормально, но что-то еще вызывает проблемы с производительностью в цикле poll. Прежде чем менять конфигурацию, я хотел бы изучить это, чтобы вы не замаскировали более серьезную проблему.

...