Tune bloom filters

A bloom filter is an off-heap structure associated with each SSTable that checks if any data for a requested row exists in a given SSTable before doing any disk I/O to actually read from the SSTable.

Because bloom filters are probabilistic sets, they can return false positives. Additionally, they can consume a significant amount of off-heap memory, which is proportional to the number of partition keys stored in a specific SSTable. To balance memory usage and performance (successful lookups and lower read amplification), you can tune the bloom filter settings.

Bloom filters are stored off-heap so you don’t need include them when determining the -Xmx settings (the maximum memory size that the heap can reach for the JVM).

Check bloom filter performance

To get the observed bloom filters false positive rate and the number of SSTables consulted per read, run nodetool tablestats. For example, the line Bloom filter false positive rate in the output is the bloom filter size in bytes.

A high number of SSTables per read isn’t inherently a problem; some compaction strategies naturally produce many SSTables and can involve many SSTables per read. The problem occurs when bloom filters are producing too many false positives and wasting disk I/O on SSTables that otherwise wouldn’t be read.

Tune the bloom filter false positive chance

The primary way to tune bloom filters is to adjust the rate of false positives with bloom_filter_fp_chance. This value is a decimal from 0 to 1.0 (disabled). Higher values (closer to 1.0) use less memory but produce more false positives, resulting in more disk I/O, especially if SSTables are fragmented. Lower values (closer to 0) use more memory but produce fewer false positives, resulting in less disk I/O overall. Memory savings are nonlinear. For example, increasing the value from 0.01 to 0.1 saves about one third of the memory, not half.

The default value of bloom_filter_fp_chance depends on the compaction strategy. For example, the LeveledCompactionStrategy (LCS) uses a higher default value (0.1) than the SizeTieredCompactionStrategy (STCS) (0.01). This is by design because LCS is meant for fast reads. Although LCS has non-overlapping row key ranges at L1 and higher, which would perform better than STCS even in the absence of bloom filters, tuning the bloom filter false positive rate still helps LCS, particularly when there are many levels.

The ideal value depends on a table’s workloads and compaction strategy. For example, for applications that perform full table scans where bloom filters don’t effectively reduce disk I/O, you might increase the bloom filter false positive chance to save memory. Conversely, workloads that are extremely sensitive to read latency benefit from a lower false positive chance to reduce the number of SSTables that must be consulted during a read.

If you don’t want to use the default value set by a table’s compaction strategy, you can set bloom_filter_fp_chance explicitly when creating or altering a table:

  1. Use ALTER TABLE to change the bloom_filter_fp_chance property:

    ALTER TABLE users WITH bloom_filter_fp_chance = 0.1;
  2. Regenerate bloom filters after changing the bloom_filter_fp_chance property.

    Changes to table properties only apply to new SSTables. To apply the new values to existing SSTables, you must run compaction, upgrade SSTables, or both.

    • Run compaction. To manually trigger compaction, use nodetool compact. Be aware that running compaction on all tables in a keyspace is resource intensive. Instead, consider compacting tables in a rolling fashion.

    • Upgrade existing SSTables to compute new bloom filters with nodetool upgradesstables -a.

      The -a flag is required to force a rewrite. Omitting -a skips SSTables that are already on the current version, which won’t regenerate the bloom filters for those SSTables.

      • Force rewrite all SSTables for an entire node:

        nodetool upgradesstables -a
      • Force rewrite SSTables for a specific table:

        nodetool upgradesstables -a KEYSPACE_NAME TABLE_NAME

You don’t need to restart DSE after changing bloom filters and rewriting SSTables.

The -Dcassandra.max_bf_memory_mb system property limits the amount of memory used by bloom filters. The default is unlimited. DataStax strongly recommends that you don’t change this parameter because it can be extremely detrimental to read performance.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM