Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9127

Needless group coordination overhead for GlobalKTables

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.2.0
    • Fix Version/s: 2.6.0, 2.4.2, 2.5.1
    • Component/s: streams
    • Labels:
      None

      Description

      When creating a simple stream topology to just populate a GlobalKTable, I noticed from logging that the stream consumer was doing group coordination requests (JoinGroup, SyncGroup, ...) to the server, which it had no reason to do since the global consumer thread populating the table fetches from all partitions and thus doesn't use the group requests. So this adds needless overhead on the client, network, and server.

      I tracked this down to the stream thread consumer, which is created regardless of whether it's needed based solely on NUM_STREAM_THREADS_CONFIG which defaults to 1 I guess.

      I found that setting NUM_STREAM_THREADS_CONFIG to 0 will prevent this from happening, but it'd be a worthwhile improvement to be able to override this setting in cases of topologies like this that don't have any need for stream threads. Hence this ticket.

      I originally asked about this on the users mailing list where Bruno suggested I file it as an improvement request.

      Here's the Scala code that I'm using that exhibits this:

      val builder: StreamsBuilder = new StreamsBuilder()
      val gTable = builder.globalTable[K, V](...)
      val stream = new KafkaStreams(builder.build(), props)
      stream.start()

       Not shown is the state store that I'm populating/using.

        Attachments

          Activity

            People

            • Assignee:
              ableegoldman A. Sophie Blee-Goldman
              Reporter:
              ctoomey Chris Toomey
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: