hbase寫入效能測試(從hdfs向hbase寫入資料)

來源:互聯網
上載者:User

測試叢集:9個region server(16 core + 24GB記憶體)。Hbase client機器(8 core + 32GB記憶體)

資料量:日誌資料,1122MB,儲存在hdfs中。 hbase rowkey為9個位元組,第一個位元組是hash值,後八個位元組對應long型數值;value約200b。 

寫效能關鍵影響因素

1.  rowkey分布式是否均衡,最好先瞭解rowkey的特徵,預設splitkeys,將rowkey範圍均衡地分散到各個region server上;這樣,可以減輕單點負載,提升橫向拓展能力,並減少split和compact這樣的重操作。

2. autoflush設定為false

3. 如果記憶體足夠,可以適當增大WriteBufferSize,預設2MB,我調到32MB效果不錯。

4. 適當配置寫入線程。

5. WAL設定為false,可以明顯提升速度,但是不建議這麼做,這樣可能資料丟失無法恢複。

測試結果:

1.將多列屬性值壓縮至一個列中,可以大大提升hbase寫的效率;每多一列,寫入的效能都會明顯下降。

2.一個列族N個屬性列與N個列族單個屬性列,寫入效能很接近。

3. 單個region平均可以達到2w lines/s

測試結果

一個列族 + 一個列(包含所有的屬性值)
Total time costs          :                 66s
Average byte speed        :              17MB/s
Average line speed        :       170485lines/s
Total transferred records :            11252045
Total discarded records   :                   0

一個列族 + 一個列(包含所有的屬性值)+一個空值列
Total time costs          :                 99s
Average byte speed        :              11MB/s
Average line speed        :       113657lines/s
Total transferred records :            11252045
Total discarded records   :                   0

一個列族 + 一個列(包含所有的屬性值)+三個空值列
Total time costs          :                166s
Average byte speed        :               6MB/s
Average line speed        :        67783lines/s
Total transferred records :            11252045
Total discarded records   :                   0

四個列族 + 每個列族一個列(包含所有的屬性值)
Total time costs          :                159s
Average byte speed        :               7MB/s
Average line speed        :        70767lines/s
Total transferred records :            11252045
Total discarded records   :                   0

一個列族 + 四個列(每個列包含所有的屬性值)
Total time costs          :                160s
Average byte speed        :               7MB/s
Average line speed        :        70325lines/s
Total transferred records :            11252045
Total discarded records   :                   0

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.