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

Performance bottleneck in Kafka Connect sendRecords

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Abandoned
    • 1.0.0
    • None
    • connect
    • None

    Description

      Kafka Connect is using IdentityHashMap for storing records.

      https://github.com/apache/kafka/blob/trunk/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java#L239

      Unfortunately this solution is very slow (2-4 times slower than normal HashMap / HashSet).

      Benchmark result (code in attachment). 

      Identity 4220
      Set 2115
      Map 1941
      Fast Set 2121
      

      Things are even worse when using default GC configuration
      (-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35  -Djava.awt.headless=true)

      Identity 7885
      Set 2364
      Map 1548
      Fast Set 1520
      

      Java version

      java version "1.8.0_152"
      Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
      

      This problem is greatly slowing Kafka Connect.

       

      Attachments

        1. image-2018-03-08-08-35-19-247.png
          44 kB
          Maciej Bryński
        2. MapPerf.java
          3 kB
          Maciej Bryński

        Activity

          People

            Unassigned Unassigned
            maver1ck Maciej Bryński
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: