From issues-return-176806-archive-asf-public=cust-asf.ponee.io@flink.apache.org Wed Jul 11 23:35:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2C83718077A for ; Wed, 11 Jul 2018 23:35:05 +0200 (CEST) Received: (qmail 4473 invoked by uid 500); 11 Jul 2018 21:35:05 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 4460 invoked by uid 99); 11 Jul 2018 21:35:05 -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; Wed, 11 Jul 2018 21:35:05 +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 9A6A6C0231 for ; Wed, 11 Jul 2018 21:35:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, 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 u_qK6dTnvJIQ for ; Wed, 11 Jul 2018 21:35:03 +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 DC2005F4DC for ; Wed, 11 Jul 2018 21:35:02 +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 BA2EBE1E11 for ; Wed, 11 Jul 2018 21:35: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 A8E5D27521 for ; Wed, 11 Jul 2018 21:35:00 +0000 (UTC) Date: Wed, 11 Jul 2018 21:35:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-9692) Adapt maxRecords parameter in the getRecords call to optimize bytes read from Kinesis MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-9692?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1654= 0706#comment-16540706 ]=20 ASF GitHub Bot commented on FLINK-9692: --------------------------------------- Github user tweise commented on a diff in the pull request: https://github.com/apache/flink/pull/6300#discussion_r201792650 =20 --- Diff: flink-connectors/flink-connector-kinesis/src/main/java/org/ap= ache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java --- @@ -224,10 +232,19 @@ public void run() { =09=09=09=09=09=09subscribedShard.getShard().getHashKeyRange().getStar= tingHashKey(), =09=09=09=09=09=09subscribedShard.getShard().getHashKeyRange().getEndi= ngHashKey()); =20 +=09=09=09=09=09long recordBatchSizeBytes =3D 0L; +=09=09=09=09=09long averageRecordSizeBytes =3D 0L; + =09=09=09=09=09for (UserRecord record : fetchedRecords) { +=09=09=09=09=09=09recordBatchSizeBytes +=3D record.getData().remaining= (); =09=09=09=09=09=09deserializeRecordForCollectionAndUpdateState(record)= ; =09=09=09=09=09} =20 +=09=09=09=09=09if (useAdaptiveReads && fetchedRecords.size() !=3D 0) { --- End diff -- =20 nit: && !isEmpty() > Adapt maxRecords parameter in the getRecords call to optimize bytes read = from Kinesis=20 > -------------------------------------------------------------------------= ------------- > > Key: FLINK-9692 > URL: https://issues.apache.org/jira/browse/FLINK-9692 > Project: Flink > Issue Type: Improvement > Components: Kinesis Connector > Affects Versions: 1.5.0, 1.4.2 > Reporter: Lakshmi Rao > Assignee: Lakshmi Rao > Priority: Major > Labels: performance, pull-request-available > > The Kinesis connector currently has a [constant value|https://github.com/= apache/flink/blob/master/flink-connectors/flink-connector-kinesis/src/main/= java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.= java#L213]=C2=A0set for maxRecords that it can fetch from a single Kinesis = getRecords call. However, in most realtime scenarios, the average size of t= he Kinesis record (in bytes) changes depending on the situation i.e. you co= uld be in a transient scenario=C2=A0where you are reading large sized recor= ds and would hence like to fetch fewer records in each getRecords call (so = as to not exceed the 2 Mb/sec [per shard limit|https://docs.aws.amazon.com/= kinesis/latest/APIReference/API_GetRecords.html]=C2=A0on the getRecords cal= l).=C2=A0 > The idea here is to adapt the Kinesis connector to identify an average ba= tch size prior to making the getRecords call, so that the maxRecords parame= ter can be appropriately tuned before making the call.=C2=A0 > This feature can be behind a [ConsumerConfigConstants|https://github.com/= apache/flink/blob/master/flink-connectors/flink-connector-kinesis/src/main/= java/org/apache/flink/streaming/connectors/kinesis/config/ConsumerConfigCon= stants.java]=C2=A0flag that defaults to false.=C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)