Limiting the Speed of Compactions

You can limit the speed at which HBase compactions run, by configuring hbase.regionserver.throughput.controller and its related settings. The default controller is org.apache.hadoop.hbase.regionserver.throttle.PressureAwareCompactionThroughputController, which uses the following algorithm:
  1. If compaction pressure is greater than 1.0, there is no speed limitation.
  2. In off-peak hours, use a fixed throughput limitation, configured using hbase.hstore.compaction.throughput.offpeak, hbase.offpeak.start.hour, and hbase.offpeak.end.hour.
  3. In normal hours, the max throughput is tuned between hbase.hstore.compaction.throughput.higher.bound and hbase.hstore.compaction.throughput.lower.bound (which default to 20 MB/sec and 10 MB/sec respectively), using the following formula, where compactionPressure is between 0.0 and 1.0. The compactionPressure refers to the number of store files that require compaction.
    lower + (higher - lower) * compactionPressure

To disable compaction speed limits, set hbase.regionserver.throughput.controller to org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputController.

Configure the Compaction Speed Using Cloudera Manager

Minimum Required Role: Configurator (also provided by Cluster Administrator, Full Administrator)

  1. Go to the HBase service.
  2. Click the Configuration tab.
  3. Select HBase or HBase Service-Wide.
  4. Search for HBase Service Advanced Configuration Snippet (Safety Valve) for hbase-site.xml. Paste the relevant properties from the following example into the field and modify the values as needed:
      <description>The default is 20 MB/sec</description>
      <description>The default is 10 MB/sec</description>
      <description>The default is Long.MAX_VALUE, which effectively means no limitation</description>
      <description>When to begin using off-peak compaction settings, expressed as an integer between 0 and 23.</description>
      <description>When to stop using off-peak compaction settings, expressed as an integer between 0 and 23.</description>
  5. Enter a Reason for change, and then click Save Changes to commit the changes.
  6. Restart the service.