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 487A6200C7E for ; Tue, 23 May 2017 23:56:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4721E160BC3; Tue, 23 May 2017 21:56:39 +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 671D3160BA4 for ; Tue, 23 May 2017 23:56:38 +0200 (CEST) Received: (qmail 34577 invoked by uid 500); 23 May 2017 21:56:37 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 34563 invoked by uid 99); 23 May 2017 21:56:37 -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; Tue, 23 May 2017 21:56:37 +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 D037CC18AA for ; Tue, 23 May 2017 21:56:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.794 X-Spam-Level: X-Spam-Status: No, score=-0.794 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id mQZPTikEsecW for ; Tue, 23 May 2017 21:56:33 +0000 (UTC) Received: from mail-vk0-f47.google.com (mail-vk0-f47.google.com [209.85.213.47]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A909F5F2AB for ; Tue, 23 May 2017 21:56:32 +0000 (UTC) Received: by mail-vk0-f47.google.com with SMTP id x71so65854139vkd.0 for ; Tue, 23 May 2017 14:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Tt3XTPDDpOs/tSBvx0YWa5svGmYcnG4SKvz6CnqxCrs=; b=FFx3wTnWWrqf3pdDoA59LgqoAmhQ9rfQmhlOWmZu5bf8ZbTBj4WQ7i5VcQFoROnHQ2 TsWPIkKm2IsJoRgaz8qubgvxalf2S4/d9byxCuJmzSL+Fyp/JWwXJ/0u0qWMoskMy4fn nsW9g2leswm9WvcvJpMjGpaON0sUm7uMdWjHef/JEnN4Apn34p4iuejkJ9BmLjCTtzHx QLFO3kNri9e6GRKmQsF7gTlIrLhEy84F1u2eg/634v2PQbv+a+hwgB65xpMzqEkYLLxC BHFOooTy+tMVY7NtvqcpWPvQ/Os/UcfXIm9PWBvexImlytbWUGgWrCI6Xlk5zF1PSqPp 69Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Tt3XTPDDpOs/tSBvx0YWa5svGmYcnG4SKvz6CnqxCrs=; b=iS8HdNvn9gF/sFn5te2RdaF8HasKngNkSdDaJtwSfdBts6Hlx8KZDT20Ka8HfdrrbP 4RDgIOvVhBpTSKtggVRrbPBThPFhDNj99OjdijL59/ipEKRzAUiPGIC1H81d6FOX2e/M 1jVgtIE++K7V6LIfG30u63GmY0K/6E3fIK9/7EjL9lXpkvY/eL3wlv4kAkvB3tzvCfSk 4hZgrkznvGr+OZdTmVwm8fE6kt6QIdDXEH0xUJ4pISxcldk9061f7cggkFFYm/uoP43m XtLjNnIVVbH5qcAmAG6kyE0rGNb/4V65Rfb+Bc4M4/I9QhfBmYcIGxxXs9BYjY8HRhk1 75+w== X-Gm-Message-State: AODbwcCAZzVA+bn9qhfd+Oirb9Hp+eQJG/TP/9Jh90qVjARJtYxPS2e+ ag/xyn1MBiS5/kLEfNhU+d3GavOzW9IP X-Received: by 10.31.61.16 with SMTP id k16mr12192241vka.43.1495576591372; Tue, 23 May 2017 14:56:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.171.6 with HTTP; Tue, 23 May 2017 14:56:30 -0700 (PDT) Received: by 10.103.171.6 with HTTP; Tue, 23 May 2017 14:56:30 -0700 (PDT) In-Reply-To: References: <005201d2d31d$6dd98550$498c8ff0$@gridgain.com> <010301d2d3a2$7da4a2f0$78ede8d0$@gridgain.com> From: Michael Griggs Date: Tue, 23 May 2017 22:56:30 +0100 Message-ID: Subject: Re: Inefficient approach to executing remote SQL queries To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="001a114d931476e8270550380f95" archived-at: Tue, 23 May 2017 21:56:39 -0000 --001a114d931476e8270550380f95 Content-Type: text/plain; charset="UTF-8" The problem here is with the initial opening of connections. With a client who connects and disconnects quickly, and frequently, a 30-second plus connection time is not workable. Mike On 23 May 2017 6:51 pm, "Dmitriy Setrakyan" wrote: > Why do we turn off the connections, once established? Why not keep them > open, until an endpoint explicitly closes them? > > On Tue, May 23, 2017 at 2:16 AM, Sergi Vladykin > wrote: > > > Michael, > > > > I see your point. I think it must not be too hard to start asynchronously > > establishing connections to all the needed nodes. > > > > I've created respective issue in Jira: > > https://issues.apache.org/jira/browse/IGNITE-5277 > > > > Sergi > > > > 2017-05-23 11:56 GMT+03:00 Michael Griggs : > > > > > Hi Val > > > > > > This is precisely my point: it's only a minor optimization until the > > point > > > when establishing each connection takes 3-4 seconds, and we establish > 32 > > of > > > them in sequence. At that point it becomes a serious issue: the > customer > > > cannot run SQL queries from their development machines without them > > timing > > > out once out of every two or three runs. These kind of problems > > undermine > > > confidence in Ignite. > > > > > > Mike > > > > > > > > > -----Original Message----- > > > From: Valentin Kulichenko [mailto:valentin.kulichenko@gmail.com] > > > Sent: 22 May 2017 19:15 > > > To: dev@ignite.apache.org > > > Subject: Re: Inefficient approach to executing remote SQL queries > > > > > > Hi Mike, > > > > > > Generally, establishing connections in parallel could make sense, but > > note > > > that in most this would be a minor optimization, because: > > > > > > - Under load connections are established once and then reused. If > you > > > observe disconnections during application lifetime under load, then > > > probably this should be addressed first. > > > - Actual communication is asynchronous, we use NIO for this. If > > > connection already exists, sendGeneric() basically just puts a > message > > > into > > > a queue. > > > > > > -Val > > > > > > On Mon, May 22, 2017 at 7:04 PM, Michael Griggs < > > > michael.griggs@gridgain.com > > > > wrote: > > > > > > > Hi Igniters, > > > > > > > > > > > > > > > > Whilst diagnosing a problem with a slow query, I became aware of a > > > > potential issue in the Ignite codebase. When executing a SQL query > > > > that is to run remotely, the IgniteH2Indexing#send() method is > called, > > > > with a Collection as one of its parameters. This > > > > collection is iterated sequentially, and ctx.io().sendGeneric() is > > > > called synchronously for each node. This is inefficient if > > > > > > > > > > > > > > > > a) This is the first execution of a query, and thus TCP > > connections > > > > have to be established > > > > > > > > b) The cost of establishing a TCP connection is high > > > > > > > > > > > > > > > > And optionally > > > > > > > > > > > > > > > > c) There are a large number of nodes in the cluster > > > > > > > > > > > > > > > > In my current situation, developers want to run test queries from > > > > their code running locally, but connected via VPN to their UAT server > > > > environment. > > > > The > > > > cost of opening a TCP connection is in the multiple seconds, as you > > > > can see from this Ignite log file snippet: > > > > > > > > 2017-05-22 18:29:48,908 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:56924, > > > > rmtAddr=/10.132.80.3:47100] > > > > > > > > 2017-05-22 18:29:52,294 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:56923, > > > > rmtAddr=/10.132.80.30:47102] > > > > > > > > 2017-05-22 18:29:58,659 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:56971, > > > > rmtAddr=/10.132.80.23:47101] > > > > > > > > 2017-05-22 18:30:03,183 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:56972, > > > > rmtAddr=/10.132.80.21:47100] > > > > > > > > 2017-05-22 18:30:06,039 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:56973, > > > > rmtAddr=/10.132.80.21:47103] > > > > > > > > 2017-05-22 18:30:10,828 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:57020, > > > > rmtAddr=/10.132.80.20:47100] > > > > > > > > 2017-05-22 18:30:13,060 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:57021, > > > > rmtAddr=/10.132.80.29:47103] > > > > > > > > 2017-05-22 18:30:22,144 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:57022, > > > > rmtAddr=/10.132.80.22:47103] > > > > > > > > 2017-05-22 18:30:26,513 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:57024, > > > > rmtAddr=/10.132.80.20:47101] > > > > > > > > 2017-05-22 18:30:28,526 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/7.1.14.242:57025, > > > > rmtAddr=/10.132.80.30:47103] > > > > > > > > > > > > > > > > Comparing the same code that is executed inside of the UAT > environment > > > > (so not using the VPN): > > > > > > > > 2017-05-22 18:22:18,102 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/10.175.11.38:53288, > > > > rmtAddr=/10.175.11.58:47100] > > > > > > > > 2017-05-22 18:22:18,105 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/10.175.11.38:45890, > > > > rmtAddr=/10.175.11.54:47101] > > > > > > > > 2017-05-22 18:22:18,108 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/127.0.0.1:47582, > > > > rmtAddr=/127.0.0.1:47100] > > > > > > > > 2017-05-22 18:22:18,111 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/127.0.0.1:45240, > > > > rmtAddr=/127.0.0.1:47103] > > > > > > > > 2017-05-22 18:22:18,114 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/10.175.11.38:46280, > > > > rmtAddr=/10.175.11.15:47100] > > > > > > > > 2017-05-22 18:22:18,118 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/10.132.80.21:51476, > > > > rmtAddr=/10.132.80.29:47103] > > > > > > > > 2017-05-22 18:22:18,120 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/10.132.80.21:56274, > > > > rmtAddr=pocfd-master1/10.132.80.22:47103] > > > > > > > > 2017-05-22 18:22:18,124 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/10.132.80.21:53558, > > > > rmtAddr=pocfd-ignite1/10.132.80.20:47101] > > > > > > > > 2017-05-22 18:22:18,127 INFO [TcpCommunicationSpi] - Established > > > > outgoing communication connection [locAddr=/10.132.80.21:56216, > > > > rmtAddr=/10.132.80.30:47103] > > > > > > > > > > > > > > > > This is a design flaw in the Ignite code, as we are relying on the > > > > client's network behaving in a particular way (i.e., port opening > being > > > very fast). > > > > We should instead try to mask this potential slowness by establishing > > > > connections in parallel, and waiting on the results. > > > > > > > > > > > > > > > > I would like to hear others thoughts and comment before we open a > JIRA > > > > to look at this. > > > > > > > > > > > > > > > > Regards > > > > > > > > Mike > > > > > > > > > > > > > > > > > --001a114d931476e8270550380f95--