Home > Database > Mysql Tutorial > body text

GPDB并行加载测试

WBOY
Release: 2016-06-07 16:11:17
Original
1458 people have browsed it

测试文件信息 10G Dec 12 14:10 A111G Dec 12 14:32 A210G Dec 12 14:10 B111G Dec 12 14:35 B2 GPFDIST 方案一 单台服务器 drop table if exists host_1;drop EXTERNAL TABLE if exists exttable_ext_1_host;drop table if exists host_1_err;create table

测试文件信息

10G Dec 12 14:10 A1
11G Dec 12 14:32 A2
10G Dec 12 14:10 B1
11G Dec 12 14:35 B2
Copy after login

GPFDIST

方案一 单台服务器

drop table if exists host_1;
drop EXTERNAL TABLE if exists exttable_ext_1_host;
drop table if exists host_1_err;
create table host_1 (like sourcetable) distributed randomly;
CREATE EXTERNAL TABLE exttable_ext_1_host (like sourcetable) LOCATION ('gpfdist://10.2.22.81:9999/A*') FORMAT 'text' (delimiter as ',' null as '' escape 'OFF') ENCODING 'UTF8' LOG ERRORS INTO host_1_err SEGMENT REJECT LIMIT 100 PERCENT;
insert into host_1 select * from exttable_ext_1_host;
Copy after login

方案二 两台服务器

drop table if exists host_2;
drop EXTERNAL TABLE if exists exttable_ext_2_host;
drop table if exists host_2_err;
create table host_2 (like sourcetable) distributed randomly;
CREATE EXTERNAL TABLE exttable_ext_2_host (like sourcetable) LOCATION ('gpfdist://10.2.22.81:9999/B1','gpfdist://10.2.22.82:9999/B2') FORMAT 'text' (delimiter as ',' null as '' escape 'OFF') ENCODING 'UTF8' LOG ERRORS INTO host_2_err SEGMENT REJECT LIMIT 100 PERCENT;
insert into host_2 select * from exttable_ext_2_host;
Copy after login

GPLOAD

方案三

gpload单台

---
VERSION: 1.0.0.1
DATABASE: gpdb
USER: gpadmin
HOST: 10.4.2.4
PORT: 5432

GPLOAD:
  INPUT:
    - SOURCE:
        LOCAL_HOSTNAME:
          - 10.2.22.81
        PORT: 9999
        FILE:
          - /data/ptest/A*
    - FORMAT: text
    - DELIMITER: ','
    - ESCAPE: 'OFF'
    - NULL_AS: ''
    - ENCODING: UTF8
    - ERROR_LIMIT: 10000
    - ERROR_TABLE: host_1_err

  OUTPUT:
    - TABLE: host_1
    - MODE: insert
Copy after login

方案四

gpload两台

测试结果

为了防止缓存干扰测试,经过多次测试结果如下,可以发现方案二明显优于方案一

. 文件信息s文件 | 文件大小 | 入库大小 | 插入记录数量 | 异常记录数量------| --------------------------------------------方案一 | 21GB | 25GB |49826141 |2199方案二 | 21GB | 25GB | 52108083| 1867

. 加载耗时

不清楚为什么第1次读取的时候(测试序列一的方案一/二)和之后的差别这么大可能与gpfs有关系

方案四的B机文件读取失败,而且整个测试过程中方案三/四感觉并不是非常稳定(hang住),鉴于方案三对比方案一并没有太大优势,而且通过观察方案四可以发现A机加载的时间已经达到22.24s,对比方案二可能并不会有优势,因此未完成测试

测试次序 方案一 方案二 方案三 方案四
测试次序一 440403.263 ms 204201.096 ms 36.41 seconds 22.24 seconds+B?
测试次序二 35854.612 ms 26303.240 ms 方案三 方案四
测试次序三 42007.990 ms 25593.730 ms 方案三 方案四
测试次序四 43795.502 ms 25706.479 ms 方案三 方案四
测试次序五 36576.681 ms 26405.977 ms 方案三 方案四

-EOF-

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template