Created on 08-29-2017 08:07 AM - edited 08-17-2019 11:24 AM
purpose of this article is to compare the upload time between three different
methods for uploading same structured datasets into Hadoop (two methods) and
MariaDB (one method).
Assumptions & Design
a small environment is used to deploy three node Hadoop cluster (one master node, two worker nodes). The exercise will be run from my laptop which has the following specs:
Processor Name: Intel Core i7
Processor Speed: 2.5 GHz
Number of Processors: 1
Total Number of Cores: 4
Memory: 16 GB
The Hadoop cluster will be virtualized on top of my Mac machine by “Oracle VM VirtualBox Manager”. The virtual Hadoop nodes running will have the following specs:
Table 1: Hadoop Cluster –nodes’ specifications
|Specification||Namenode (Master node)||Datanode#1 (Worker node #1)||Datanode #2 (Worker node #2)|
|Memory||4646 MB||3072 MB||3072 MB|
|Hard disk size||20 GB||20 GB||20 GB|
The MariaDB standalone virtual machine was used for installing MariaDB database with the following specs:
IP Address: 192.168.43.55
Disk: 40 GB
O.S: Linux Centos 7
The Semi-structured Datasets were used is the mail archive for Apache Software Foundation (ASF), it was around 200GB of total size. The mail archive contains communications happened regarding more than 80 open-source projects, such as: (such as Hadoop, Hive, Sqoop, Zookeeper, Hbase, Storm, Kafka and much more). The mail archive could be downloaded simply using "wget" command or any other tool from this URL: http://mail-archives.apache.org/mod_mbox/
Results collected from uploading mails files to Hadoop cluster
The following results table was collected after distinct 14 uploads for different 13 sub-directories that vary in sizes, number of contained files and sizes of contained files. The last upload was done for testing upload of all previous 13 sub-directories at once. Two upload methods used that are significantly changed in upload time, the first method used is the normal upload for all files directly from local files system of the Hadoop cluster. The second method used is Hadoop Archive (HAR), which is a Hadoop capability used to combine files together in an archiver before writing it back to HDFS.
Table 2: Results collected from uploading mails files to Hadoop cluster
|Loaded directory/directories||Directory/Directories size (KB)||Number of uploaded files||Avg. size of uploaded files (KB)||Load time (1st attempt)||Load time (2nd attempt)||Load using Hadoop Archive (1st attempt)||Load using Hadoop Archive (2nd attempt)|
|All previous directories||3504280||176603||19.84||224m49.673s||Not tested||8m13.950s||8m46.144s|
Results collected from uploading mails files to MariaDB
The following results were collected after distinct 14 uploads for different 13 sub-directories that vary in sizes, number of contained files and sizes of contained files. The last upload was done for testing upload of all previous 13 sub-directories at once.
Table 3: Results collected from uploading mails files to MariaDB
|Loaded directory||Total size (KB)||Number of loaded files||Avg. size of loaded files (KB)||Load time (1st attempt)||Load time (2nd attempt)|
|All previous directories||3504280||176603||19.84||46m55.311s||17m31.941s|
Figure 1: Uploaded data size in KB vs upload time in sec.
Figure 2: No of uploaded files vs upload time in sec.
Traditional data warehouses could be tuned to store small-sized semi-structured data. This could be valid and applicable for small-size upload. By increasing number of files, it may not be the best option, especially when uploading massive number of files of file (millions and above).
Uploading small files into Hadoop is a resource consuming process, uploading massive number of small files could affect the performance of the Hadoop cluster dramatically; normal files upload to HDFS is creating a separate Map-Reduce process for every single file.
Using Hadoop Archive (HAR) tool is critical when loading massive number of small files at once. The HAR concept is to append files together by using a special delimiter before being uploaded to HDFS which reduces uploading time significantly. It’s important to note that the query time of a HAR from Hadoop will not be equivalent to Hadoop direct uploading without using HAR; because processing HAR for query requires an additional process for internal de-indexing.
I’ll try doing the same exercise using bigger cluster with higher hardware specs to validate the same conclusion.