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

Client producer reduce RecordAccumulator locks in producer thread

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • clients, producer
    • None

    Description

      Kafka Java client RecordAccumulator uses a thread to manage and send batches as they are ready. The algorithm in both ready() and drain() use slightly more locking than strictly necessary, which holds up the producer thread from writing to batch.

      By reducing the code executed in the lock, we see a 11% reduction in spin-loop lock-related CPU in the producer threads (as they wait for an available batch to append).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jasonkoch Jason Koch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: