天天看點

CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論

伺服器配置

目前hive通過群集方式安裝,分别安裝到node1-node3中,各主機的配置如下表:

主機 CPU 記憶體 硬碟
Node1 1顆1核 14G
Node2 2G
Node3

建立test資料庫

1.    create table test(    
2.        name String,  
3.        gender String,  
4.        age String,  
5.        city String,  
6.        idNumber String,  
7.        cardNumber String,  
8.        balance String  
9.    )    
10.    row format delimited fields terminated by ',' lines terminated by '\n'  
stored as textfile;            

測試10萬條資料

使用createtestdata.jar生成10萬條測試資料,并導入hdfs,使用指令行put到hdfs的/data目錄,或使用hdfs帳戶登入hue,上傳至/data目錄

1.    #切換至hdfs使用者  
2.    su hdfs  
3.    #将檔案testdata_10w.txt存入hdfs的/data目錄  
4.    hadoop fs -put testdata_10w.txt /data  
5.    #檢視目錄情況  
6.    hadoop fs -ls /data             
CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論

使用如下指令,将資料導入test表中

1.    load data inpath '/data/testdata_10w.txt' into table test;             
CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論

執行sql語句,查詢測試資料中各城市的人員年齡分布情況及總餘額資訊:

1.    SELECT  
2.        city AS city_name,  
3.        count(NAME) AS total_persons,  
4.        max(age) AS max_age,  
5.        min(age) AS min_age,  
6.        round(avg(age), 2) AS avg_age,  
7.        sum(balance) AS total_balance  
8.    FROM  
9.        test  
10.    GROUP BY  
11.        city             

執行結果:31.93s

CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論

測試100萬條資料

執行結果:43.827s

CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論

測試1000萬條資料

執行結果:142.885s

CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論

測試1億條資料

執行結果:1035.759s,約17分鐘

CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論
CDH6.2版本的HIVE性能測試伺服器配置建立test資料庫測試10萬條資料測試100萬條資料測試1000萬條資料測試1億條資料測試結論

測試結論

在目前伺服器配置情況下,測試結果:

資料量 10萬 100萬 1000萬 1億
結果 31.93s 43.827s 142.885s 1035.759s