HBaseパフォーマンス最適化シリーズ(1)



Hbase Performance Optimization Series



IOのパフォーマンスの最適化(1)

サーバーIOが弱い場合は、電流制限制御を実行します。

圧縮スループットの制限

有効なバージョン1.1.0 + 2.0.0 +
hbase-2.0.0バージョンにはデフォルトの制限があり、hbase-1.xバージョンはデフォルトで制限されていません。



HBASE-8329
関連パラメーター:
hbase.regionserver.throughput.controller
hbase.hstore.compaction.throughput.offpeak
hbase.hstore.compaction.throughput.lower.bound
hbase.hstore.compaction.throughput.higher.bound
hbase.hstore.blockingStoreFiles

次のように説明します。
圧縮スループット制限メカニズムを向上させます。
デフォルト値はorg.apache.hadoop.hbase.regionserver.compactions.PressureAwareCompactionThroughputControllerです。
次のようにスループットが制限されます。



  1. オフピーク時に固定制限を使用するhbase.hstore.compaction.throughput.offpeak(デフォルトは Long.MAX_VALUE 、つまり制限なし)
  2. 通常の時間帯は、hbase.hstore.compaction.throughput.lower.bound(デフォルトは10Mb / s)およびhbase.hstore.compaction.throughput.higher.bound(デフォルトは20Mb / s)に制限され、式 'lower +(higer-lower)* param'、param range:[ 0,1]であり、RegionServer上のStoreFileの数に基づいて計算されます。
  3. 一部のストアにStoreFileが多すぎる場合(StoreFileの数が上限を超えている場合)hbase.hstore.blockingStoreFiles)、ピークかオフピークかに関係なく、制限はありません。

can hbase.regionserver.throughput.controller as org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputControllerに設定し、スループット制御を無効にします。

また、ConfigurationObserverオブザーバーが実装されています。つまり、クラスターを再起動しなくても、上記のすべての構成を変更できます。

パッケージパスの1.3.0バージョンorg.apache.hadoop.hbase.regionserver.throttle



部分的なコードの実装

// NoLimitThroughputController does not control traffic, code implementation is not public class PressureAwareCompactionThroughputController implements CompactionThroughputController { / / Control Compact traffic, if the speed is too fast through Sleep control @Override public long control(String compactionName, long size) throws InterruptedException { // Running Compact ActiveCompaction compaction = activeCompactions.get(compactionName) compaction.totalSize += size long deltaSize = compaction.totalSize - compaction.lastControlSize} long now = EnvironmentEdgeManager.currentTime() double maxThroughputPerCompaction = this.maxThroughput / activeCompactions.size() // Compaction minimum time long minTimeAllowed = (long) (deltaSize / maxThroughputPerCompaction * 1000) long elapsedTime = now - compaction.lastControlTime compaction.lastControlSize = compaction.totalSize if (elapsedTime >= minTimeAllowed) { // If the speed is normal compaction.lastControlTime = EnvironmentEdgeManager.currentTime() return 0 } // If the speed is too fast, the Compact time is less than the minimum time // sleep for a while long sleepTime = minTimeAllowed - elapsedTime Thread.sleep(sleepTime) compaction.numberOfSleeps++ compaction.totalSleepTime += sleepTime compaction.lastControlTime = EnvironmentEdgeManager.currentTime() return sleepTime } }

フラッシュ電流制限

有効なバージョン1.3.0 + 2.0.0 +
デフォルトでは有効になっていません

HBASE-14969
関連パラメーター:
hbase.regionserver.throughput.controller
hbase.hstore.flush.throughput.upper.bound
hbase.hstore.flush.throughput.lower.bound
hbase.hstore.flush.throughput.tune.period

次のように説明します。
Flushのフロー制御を向上させます。デフォルトでは制限はありません。org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputController次のように変更できますorg.apache.hadoop.hbase.regionserver.throttle.PressureAwareFlushThroughputControllerトラフィックの制限を設定できます。リファレンスコンパクション電流制限ロジック

コード実装リファレンス圧縮電流制限の実装