Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7713E200CFB for ; Fri, 25 Aug 2017 11:58:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7592616C4AA; Fri, 25 Aug 2017 09:58:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B96A916C4AE for ; Fri, 25 Aug 2017 11:58:04 +0200 (CEST) Received: (qmail 6211 invoked by uid 500); 25 Aug 2017 09:58:03 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 6201 invoked by uid 99); 25 Aug 2017 09:58:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Aug 2017 09:58:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 18E89C0EA7 for ; Fri, 25 Aug 2017 09:58:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id wYLmujl4xhO4 for ; Fri, 25 Aug 2017 09:58:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id DF7D85FE2E for ; Fri, 25 Aug 2017 09:58:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0B6E4E0D49 for ; Fri, 25 Aug 2017 09:58:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5749A25386 for ; Fri, 25 Aug 2017 09:58:00 +0000 (UTC) Date: Fri, 25 Aug 2017 09:58:00 +0000 (UTC) From: =?utf-8?Q?J=C3=A9r=C3=A9mie_Vexiau_=28JIRA=29?= To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (BEAM-2803) JdbcIO read is very slow when query return a lot of rows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 25 Aug 2017 09:58:05 -0000 [ https://issues.apache.org/jira/browse/BEAM-2803?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] J=C3=A9r=C3=A9mie Vexiau updated BEAM-2803: --------------------------------- Attachment: (was: test2M.png) > JdbcIO read is very slow when query return a lot of rows > -------------------------------------------------------- > > Key: BEAM-2803 > URL: https://issues.apache.org/jira/browse/BEAM-2803 > Project: Beam > Issue Type: Improvement > Components: sdk-java-extensions > Affects Versions: Not applicable > Reporter: J=C3=A9r=C3=A9mie Vexiau > Assignee: Reuven Lax > Labels: performance > Fix For: Not applicable > > > Hi, > I'm using JdbcIO reader in batch mode with the postgresql driver. > my select query return more than 5 Millions rows > using cursors with Statement.setFetchSize(). > these ParDo are OK : > {code:java} > .apply(ParDo.of(new ReadFn<>(this))).setCoder(getCoder()) > .apply(ParDo.of(new DoFn>() { > private Random random; > @Setup > public void setup() { > random =3D new Random(); > } > @ProcessElement > public void processElement(ProcessContext context) { > context.output(KV.of(random.nextInt(), context.element())); > } > })) > {code} > but reshuffle is very very slow.=20 > it must be the GroupByKey with more than 5 millions of Key. > {code:java} > .apply(GroupByKey.create()) > {code} > is there a way to optimize the reshuffle, or use another method to preven= t fusion ?=20 > thanks in advance, > edit:=20 > I add some tests=20 > I use google dataflow as runner, with 1 worker, 2 max, and workerMachineT= ype n1-standard-2 > and autoscalingAlgorithm THROUGHPUT_BASED > First one : query return 500 000 results :=20 > !test500k.png|thumbnail! > as we can see, > parDo(Read) is about 1300 r/s > groupByKey is about 1080 r/s > 2nd : query return 1 000 000 results=20 > !test1M.png|thumbnail! > parDo(read) =3D> 1480 r/s > groupByKey =3D> 634 r/s > 3rd : query return 1 500 000 results > !test1500K.png|thumbnail! > parDo(read) =3D> 1700 r/s > groupByKey =3D> 565 r/s > 4th query return 2 000 000 results > !test2M.jpg|thumbnail! > parDo(read) =3D> 1485 r/s > groupByKey =3D> 537 r/s > As we can see, groupByKey rate decrease when number of record are more i= mportant. > ps: 2nd worker start just after ParDo(read) is succeed -- This message was sent by Atlassian JIRA (v6.4.14#64029)