暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

性能测试报告:SeaTunnel 批量同步数据比 GLUE 快 420%!

SeaTunnel 2023-03-28
1805

点击蓝字 关注我们

    

SeaTunnel Zeta 在社区的共同努力之下正式发布。继 SeaTunnel 与 DataX、Airbyte 进行性能测试对比之后,我们还将 SeaTunnel 与热门数据同步工具 AWS GLUE 的性能进行比较。


结果显示,SeaTunnel 批量同步 MySQL 数据到 MySQL 比 GLUE 快 420%。 


为了保证对比测试的准确性,我们选取了相同的测试场景:在相同的资源情况下,测试SeaTunnel和AWS GLUE将数据批量从MySQL同步到MySQL,所需要花费的时间,并进行对比。
我们在MySQL中创建了一张包含了31个字段的表,主键选择递增的ID,其他所有字段采用随机的方式生成,除了主键外均不设置索引。建表语句为:

    create table test.type_source_table
    (
    id int auto_increment
    primary key,
    f_binary binary(64) null,
    f_blob blob null,
    f_long_varbinary mediumblob null,
    f_longblob longblob null,
    f_tinyblob tinyblob null,
    f_varbinary varbinary(100) null,
    f_smallint smallint null,
    f_smallint_unsigned smallint unsigned null,
    f_mediumint mediumint null,
    f_mediumint_unsigned mediumint unsigned null,
    f_int int null,
    f_int_unsigned int unsigned null,
    f_integer int null,
    f_integer_unsigned int unsigned null,
    f_bigint bigint null,
    f_bigint_unsigned bigint unsigned null,
    f_numeric decimal null,
    f_decimal decimal null,
    f_float float null,
    f_double double null,
    f_double_precision double null,
    f_longtext longtext null,
    f_mediumtext mediumtext null,
    f_text text null,
    f_tinytext tinytext null,
    f_varchar varchar(100) null,
    f_date date null,
    f_datetime datetime null,
    f_time time null,
    f_timestamp timestamp null
    );



    SeaTunnel任务配置


    在SeaTunnel中,我们根据ID字段来进行数据拆分,分成多个子任务进行数据处理。下面是SeaTunnel的配置文件:

      env {
      job.mode = "BATCH"
      checkpoint.interval = 300000
      }
      source {
      Jdbc {
      url = "jdbc:mysql://XXX:3306/test"
      driver = "com.mysql.cj.jdbc.Driver"
      user = "root"
      password = "password"
      connection_check_timeout_sec = 100
      query = "select id, f_binary, f_blob, f_long_varbinary, f_longblob, f_tinyblob, f_varbinary, f_smallint, f_smallint_unsigned, f_mediumint, f_mediumint_unsigned, f_int, f_int_unsigned, f_integer, f_integer_unsigned, f_bigint, f_bigint_unsigned, f_numeric, f_decimal, f_float, f_double, f_double_precision, f_longtext, f_mediumtext, f_text, f_tinytext, f_varchar, f_date, f_datetime, f_time, f_timestamp from test"
      partition_column = "id"
      partition_num = 40
      parallelism = 2
      }
      }
      sink {
      Jdbc {
      url = "jdbc:mysql://XXX:3306/test"
      driver = "com.mysql.cj.jdbc.Driver"
      user = "root"
      password = "password"
      query = "insert into test_1 values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
      }
      }

      在固定JVM内存为4G,Parallelism数为2的情况下, 用时1965S完成同步。基于该结论,我们在相同的内存和并发数上,测试GLUE能够达到的速度。



      GLUE任务配置


      创建MySQL->MySQL的Job:

      配置源与目标连接:

      Job配置:
      调整内存:Job参数配置

      --conf spark.yarn.executor.memory=4g
      在该配置下,测得GLUE用时8191s完成同步。



      结论


      在对比了最佳的配置之后,我们针对不同的内存大小进行了更加深入的对比。在相同的环境下,重复测试得到如下对比结果图表。

      单位:秒

      Note:本次对比基于SeaTunnel: commit id f57b897,欢迎大家下载测试!

      Apache SeaTunnel


      Apache SeaTunnel(Incubating) 是一个分布式、高性能、易扩展、用于海量数据(离线&实时)同步和转化的数据集成平台

      仓库地址: 
      https://github.com/apache/incubator-seatunnel

      网址:
      https://seatunnel.apache.org/

      Proposal:
      https://cwiki.apache.org/confluence/display/INCUBATOR/SeaTunnelPro

      Apache SeaTunnel(Incubating)  下载地址:
      https://seatunnel.apache.org/download
       
      衷心欢迎更多人加入!

      我们相信,在「Community Over Code」(社区大于代码)、「Open and Cooperation」(开放协作)、「Meritocracy」(精英管理)、以及「多样性与共识决策」等 The Apache Way 的指引下,我们将迎来更加多元化和包容的社区生态,共建开源精神带来的技术进步!

      我们诚邀各位有志于让本土开源立足全球的伙伴加入 SeaTunnel 贡献者大家庭,一起共建开源!

      提交问题和建议:
      https://github.com/apache/incubator-seatunnel/issues

      贡献代码:
      https://github.com/apache/incubator-seatunnel/pulls

      订阅社区开发邮件列表 : 
      dev-subscribe@seatunnel.apache.org

      开发邮件列表:
      dev@seatunnel.apache.org

      加入 Slack:
      https://join.slack.com/t/apacheseatunnel/shared_invite/zt-1cmonqu2q-ljomD6bY1PQ~oOzfbxxXWQ

      关注 Twitter: 
      https://twitter.com/ASFSeaTunnel

      活动推荐




      点击图片或阅读原文,了解活动详情。

      文章转载自SeaTunnel,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

      评论