apache/cassandra · warning

Detected high '{}' setting of {} for device '{}' of data dir

Error message

Detected high '{}' setting of {} for device '{}' of data directory '{}'. It is recommended to set this value to 8KB (or lower) on SSDs or 64KB (or lower) on HDDs to prevent excessive IO usage and page cache churn on read-intensive workloads.

What it means

The checkReadAheadKbSetting startup check reads /sys/block/*/queue/read_ahead_kb for each data directory's block device. If the value exceeds MAX_RECOMMENDED_READ_AHEAD_KB_SETTING, it warns that read-ahead is too high and recommends 8KB on SSDs or 64KB on HDDs to avoid excessive IO and page-cache churn on read-intensive workloads. Startup continues.

Source

Thrown at src/java/org/apache/cassandra/service/StartupChecks.java:763

                try
                {
                    Path readAheadKBPath = StartupChecks.getReadAheadKBPath(blockDeviceDirectory);

                    if (readAheadKBPath == null || Files.notExists(readAheadKBPath))
                    {
                        logger.debug("No 'read_ahead_kb' setting found for device {} of data directory {}.", blockDeviceDirectory, dataDirectory);
                        continue;
                    }

                    final List<String> data = Files.readAllLines(readAheadKBPath);
                    if (data.isEmpty())
                        continue;

                    int readAheadKbSetting = Integer.parseInt(data.get(0));

                    if (readAheadKbSetting > MAX_RECOMMENDED_READ_AHEAD_KB_SETTING)
                    {
                        logger.warn("Detected high '{}' setting of {} for device '{}' of data directory '{}'. It is " +
                                    "recommended to set this value to 8KB (or lower) on SSDs or 64KB (or lower) on HDDs " +
                                    "to prevent excessive IO usage and page cache churn on read-intensive workloads.",
                                    readAheadKBPath, readAheadKbSetting, blockDeviceDirectory, dataDirectory);
                    }
                }
                catch (final IOException e)
                {
                    logger.warn("IO exception while reading file {}.", blockDeviceDirectory, e);
                }
            }
        }
    };

    public static final StartupCheck checkMaxMapCount = new StartupCheck()
    {
        @Override
        public String name()
        {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set read-ahead low for the device: `blockdev --setra 16 /dev/<dev>` (16 sectors = 8KB) or echo the value to /sys/block/<dev>/queue/read_ahead_kb.
  2. Persist the setting with a udev rule or /etc/rc.local / systemd unit so it survives reboots.
  3. On HDDs keep it at or below 64KB; on SSDs 8KB or lower.
  4. Restart Cassandra and confirm the warning is gone.

Example fix

# before
cat /sys/block/nvme0n1/queue/read_ahead_kb -> 128
# after
echo 8 > /sys/block/nvme0n1/queue/read_ahead_kb  # persist via udev rule
Defensive patterns

Strategy: validation

Validate before calling

#!/bin/sh
for dev in $(df --output=source /var/lib/cassandra/data | tail -n +2 | xargs -n1 basename); do
  ra=$(cat /sys/block/${dev%/[^ ]*}/queue/read_ahead_kb 2>/dev/null || echo unknown);
  [ "$ra" != unknown ] && [ "$ra" -le 64 ] || echo "read_ahead_kb too high on $dev: $ra";
done

Prevention

When it happens

Trigger: Any data directory's block device reports read_ahead_kb greater than the maximum recommended value during startup.

Common situations: Default 128KB (or 4096KB on some NVMe drivers) kernel read-ahead on SSD-backed nodes, cloud instance images with generic block tuning, devices never tuned post-provisioning.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/db7022e4508eca45. Report an issue: GitHub.