Hello, what could be the reason that my Kafka supe...
# troubleshooting
e
Hello, what could be the reason that my Kafka supervisor creates really small segments? I checked my tuning spec and I think the values are fine, but when checking segment size via querying sys.segments, the segment size in rows and bytes is really low
Copy code
"tuningConfig": {
      "type": "kafka",
      "appendableIndexSpec": {
        "type": "onheap",
        "preserveExistingMetrics": false
      },
      "maxRowsInMemory": 150000,
      "maxBytesInMemory": 0,
      "skipBytesInMemoryOverheadCheck": false,
      "maxRowsPerSegment": 5000000,
      "maxTotalRows": null,
      "intermediatePersistPeriod": "PT10M",
      "maxPendingPersists": 0,
      "indexSpec": {
        "bitmap": {
          "type": "roaring"
        },
        "dimensionCompression": "lz4",
        "stringDictionaryEncoding": {
          "type": "utf8"
        },
        "metricCompression": "lz4",
        "longEncoding": "longs"
      },
      "indexSpecForIntermediatePersists": {
        "bitmap": {
          "type": "roaring"
        },
        "dimensionCompression": "lz4",
        "stringDictionaryEncoding": {
          "type": "utf8"
        },
        "metricCompression": "lz4",
        "longEncoding": "longs"
      },
      "reportParseExceptions": false,
      "handoffConditionTimeout": 900000,
      "resetOffsetAutomatically": false,
      "segmentWriteOutMediumFactory": null,
      "workerThreads": 2,
      "chatRetries": 8,
      "httpTimeout": "PT10S",
      "shutdownTimeout": "PT80S",
      "offsetFetchPeriod": "PT30S",
      "intermediateHandoffPeriod": "P2D",
      "logParseExceptions": false,
      "maxParseExceptions": 0,
      "maxSavedParseExceptions": 1000,
      "numPersistThreads": 1,
      "maxColumnsToMerge": -1,
      "skipSequenceNumberAvailabilityCheck": false,
      "repartitionTransitionDuration": "PT120S"
    }
Copy code
SELECT ABS("num_rows" /  1000000) as "bucket",
  COUNT(*) as segments,
  SUM("size") / 1048576 as totalSizeMiB,
  MIN("size") / 1048576 as minSizeMiB,
  AVG("size") / 1048576 as averageSizeMiB,
  MAX("size") / 1048576 as maxSizeMiB,
  SUM("num_rows") as totalRows,
  MIN("num_rows") as minRows,
  AVG("num_rows") as averageRows,
  MAX("num_rows") as maxRows,
  (AVG("size") / AVG("num_rows"))  as avgRowSizeB
FROM sys.segments
WHERE is_available = 1 AND is_realtime = 0 AND datasource = 'foo'
GROUP BY 1
ORDER BY 1;

| bucket | segments | totalSizeMiB | minSizeMiB |     averageSizeMiB | maxSizeMiB | totalRows | minRows |       averageRows | maxRows |       avgRowSizeB |
| -----: | -------: | -----------: | ---------: | -----------------: | ---------: | --------: | ------: | ----------------: | ------: | ----------------: |
|      0 |      718 |         1179 |          0 | 1.6434304176266812 |          2 |   3814744 |       1 | 5313.013927576601 |    7249 | 324.3472946022066 |
j
One reason could be early or late arrival data falling into a separate time interval buckets, for which only a few rows are received. Whenever a streaming ingestion task has to build a segment it must do it for all time intervals for which it is ingesting.
b
Also, I don't see taskDuration. Is that set well (eg, if the data is slowly arriving)?