基于Hadoop分布式缓存的研究与实践
2015-05-30梁晓杰王绍宇
梁晓杰 王绍宇



摘 要 在大规模离线数据的分析场景中,由于元数据库被频繁访问造成的性能瓶颈导致集群计算速度急剧下降。典型的Hadoop平台多基于磁盘进行数据读写,磁盘的读写速度又明显不如内存。针对这种情况,本文基于Hadoop平台,结合对其他分布式缓存的研究,提出了一种新的分布式缓存技术来加快数据的计算速度,从而提高数据的计算时效性。实验结果表明应用于Hadoop的MMap内存模型能极大提升了集群的计算速度。该模型能有效将文件映射到内存区域,减少内核与用户空间来回拷贝数据,同时数据异步式追加方式不会阻塞计算进程,能有效提升集群整体的计算能力。
关键词 Hadoop;分布式;缓存
中图分类号: TP392 文献标识码 A
Abstract In the scene of large-scale offline data analysis, some performance bottlenecks caused by frequent access to the metadata database make a sharp decline in the calculation of the cluster. Typical Hadoop platform is based on disk read and write, while the disk read and write speed is obviously slower than memory. In view of this, based on the Hadoop platform and the research of other distributed caches, this paper presents a new set of distributed cache technology to speed up the data computations, then also to improve the date timeliness. Experimental results show that the MMap memory model applied to Hadoop could greatly improve the computation of the cluster. This model could map the file to the memory area effectively, reduce the kernel and user space to copy data, and the asynchronous type of data append will not block the process, which can effectively improve the computing power of the whole cluster.
Keywords Hadoop ; Distributed ; Cache
0 引 言
国内互联网化的重心从个人扩展到企业与组织,进而推动了企业级“大数据”时代的到来。大规模数据分析无疑成为大数据时代的主要技术挑战之一,不仅表现在传统的企业结构化数据会伴随着时间的变迁而日趋膨胀,而且现代新型电子设备产生的非结构化也将对企业的数据中心基础建设造成巨大的压力。因此大规模数据的计算一方面即对单机服务器的CPU主频、内存容量和I/O吞吐量提出严苛要求,另一方面则对服务器集群在能够存储海量数据的基础上仍要兼具高速计算的能力也表现出了迫切需要。从目前发展趋势看,不出五年内,年产值在上亿元的企业,其数据量的规模必将达到千亿行级。……
