Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFxus-0000cW-47 for pgsql-general@arkaria.postgresql.org; Wed, 09 Sep 2020 11:05:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kFxur-00019W-2U for pgsql-general@arkaria.postgresql.org; Wed, 09 Sep 2020 11:05:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFxuq-00019P-Or for pgsql-general@lists.postgresql.org; Wed, 09 Sep 2020 11:05:28 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kFxun-00029C-Qj for pgsql-general@lists.postgresql.org; Wed, 09 Sep 2020 11:05:27 +0000 Received: by mail-wr1-x429.google.com with SMTP id s12so2445375wrw.11 for ; Wed, 09 Sep 2020 04:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ocado.com; s=google; h=reply-to:subject:to:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=L5+x/hLmGG9WfvQARgLAWe7CWLE6nyy6YsN+zT8NTXQ=; b=NNKoVfpEjpl/JeFSOcRrVFDwG8wQReFLctSKuPDHhNTd3QSSOCSxFSC+AhtwS/Lq5L bH1EnIUEieKLDmEVBCKpzqCNS9820YOglIS9O7UnqglXen1JOSoJOxSG6F8JLrh4Lm0D h4nmkILguORTI5NgDRUx1gLfTgdKISFgQtHk41zckC8219Q4XnmDqnNYdAJ3SSzMTveE jvWJZISmhgMr0V3y5+thejpIuvLgL8/eW2aRBmq0OPHSIYOQH/wGiVILUswMA6mcMG4O JUQypRLltl5zBsglkh8TbmgGequq+HMllVaqqwxdzpOhS/DxdM4bxUSGr5QpMJZiFqJ1 Rhag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=L5+x/hLmGG9WfvQARgLAWe7CWLE6nyy6YsN+zT8NTXQ=; b=NGKrlpneQHUs5U9YTG7HXMtCYNujH04Bl8DEFW9EyQ3YxxeHLpiviItELSPqbGDpNi TyVjyBHwsoK9CCj1f5SHlSZQXlOfM7nTEMtIFBa1AcbvGhcDNugdirrfWK5Lnu3F0QKJ +8beXqU5lIq8qYHEfETc8uNHS9GdyU9T+enRKOnsXsusRPXGcoN0VMSpjUSe2WzGbubY 4MxhahU1+AGHiCFDyXbGUVPvErUES9Y3cWxS8cD5jyBhAg0MprM8WdXtZiu2R3bzfNRz kiEdDZ2zH4yFYC21wtc6xz005h0Tzo/Rj2wp7gbnZ08uipte4PKWm+PW1xmxokgqXe83 Nudw== X-Gm-Message-State: AOAM531pBnEpGgk6CqYJdqivhkb/IXLh6WYoPJEkS9IMiwPLyh/8EzeM f2ZNIMyqU78ptOFm3fTL74s8IbaodZQu9hR9L2xNmCjpllHGafqOBN91G95BJvg5KT0H0KfvOxX z2MeEDZVCycr/8LiOqv9GiVdNfM8Vux6be7+7JHdjObFxmz21pjsSngB8V3YttcZ/ulAzd1GpN0 hHdpWpY0/8z2en35n38g== X-Google-Smtp-Source: ABdhPJyPxIpfqncXWoQkzrVHBPj1zQazbl02TzdZUQz8dwJE5jumPYrAMMqMLqg32XhVsaTjqVPCOQ== X-Received: by 2002:adf:ec82:: with SMTP id z2mr3391336wrn.214.1599649523736; Wed, 09 Sep 2020 04:05:23 -0700 (PDT) Received: from ?IPv6:2a00:23c5:ba01:4200:4685:ff:fea4:b217? ([2a00:23c5:ba01:4200:4685:ff:fea4:b217]) by smtp.gmail.com with ESMTPSA id k4sm3608134wrx.51.2020.09.09.04.05.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Sep 2020 04:05:23 -0700 (PDT) Reply-To: f.venchiarutti@ocado.com Subject: Re: Network performance optimization To: pgsql-general@lists.postgresql.org References: From: Fabio Ugo Venchiarutti Organization: Ocado Technology Message-ID: <0a09ed9b-a7c1-e492-f1d2-5e42e9cdfb33@ocado.com> Date: Wed, 9 Sep 2020 11:05:22 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 09/09/2020 04:59, J . Mageshwaran wrote: > Hi Team, I am performing some benchmark testing with application in aws > east 2 and dB in East 1. I am using pgbench for benchmark, the RTT > Latency between East 1 to east2 is some where between 12 to 16 ms on an > average. Is there any optimization that can be done to reduce the > latency and increase the throughout to the PostgreSQL layer? Even if network datagrams moved at the speed of light and with no serialisation/forwarding delay (which they don't), you're still going to deal with several thousand KMs of distance; I'm positively surprised you're getting such short round-trip times as it stands. If you have any control over the application code, IMO your best shot is to coalesce DB interactions into as few smarter DB queries as you can for each higher order operation (eg: RESTful API calls), as you'll be paying for that fixed RTT overhead for each command. -- Regards Fabio Ugo Venchiarutti OSPCFC Network Engineering Dpt. Ocado Technology -- Notice: This email is confidential and may contain copyright material of members of the Ocado Group. Opinions and views expressed in this message may not necessarily reflect the opinions and views of the members of the Ocado Group. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. References to the "Ocado Group" are to Ocado Group plc (registered in England and Wales with number 7098618) and its subsidiary undertakings (as that expression is defined in the Companies Act 2006) from time to time. The registered office of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way, Hatfield, Hertfordshire, AL10 9UL.