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 1lOGVg-0002lC-E1 for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Mar 2021 09:06:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lOGVf-0007FC-2P for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Mar 2021 09:06:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOGVe-0007F4-OW for pgsql-hackers@lists.postgresql.org; Mon, 22 Mar 2021 09:06:02 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lOGVZ-00033P-Qe for pgsql-hackers@postgresql.org; Mon, 22 Mar 2021 09:06:01 +0000 Received: by mail-lf1-x144.google.com with SMTP id x28so20030819lfu.6 for ; Mon, 22 Mar 2021 02:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garret-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=w+4KGvU3fIWAFuV24quZ3WgKae5sbeb/etDLPdiY0DM=; b=Xw9X4KaQ9b6UJJyQxwGReE1OuzAns6rzQ+03uIgrNCULDWXpQ14neckhUMcfXfKOgE yIwPPMzF2aFFdS8e8KjASQAm3hNR8UUPh4DIkQLAR6T2JvB315+vXVtM99+Qedr3oegD Ez/g+WLFVFdFoXrU9QN1hRsMY7LnRwPk4f7MO1YrtPobK1fVkuaO4qoF3Ve9g4Wm19ta eXs+gdi8FHFko7BLKz16FiXnRh0cqc9nl7C3dlQnzRCsp7ABymtDY5KiGkwMklDp0+2b /oY/PSrfUez8gz+eMLw2WcJCrgNa5nCF8mhGX1gy+9iypunUO43LHykX1hOZxGfx/xsR Apnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=w+4KGvU3fIWAFuV24quZ3WgKae5sbeb/etDLPdiY0DM=; b=iXFAomEF8ZPIbFNHC0gjSP11rDQ3eiUeSADYdMZionWsIq0+hNEQ5JK73UyKrQhNtH RH26LBhiCwgV00ncMazeV72YVbao9adsP7sb4Ho15Y18dtMY7rK8GZxTYvcjnd33UOU6 SuPJgBSynIHuGURrQftB4dGb3QBbi7L+T5slWhHFyDBMVwHTwSQWnMD67IIpzsmoc2o9 ZZKYCiFcn1Ijlwq/kLqI5JWaQRVUe0OyMBJEEsgJkwV00I5sxeFbdxE4GCR1GDSj92/8 usS4d470qM9hV2btcyahM5lgfVPvRjawqbyouw9BATJl75M53ZiNN5kMztxgVNMlfPGz 3ebA== X-Gm-Message-State: AOAM531cLT8ARSYRje/y+tFEjoR6xequ5AlN+xkVLzQMAOzuXduEDPSV qpQxntn7bnOb4At6vHjHkRVdyQ== X-Google-Smtp-Source: ABdhPJxHWoKmpd6yorDkqFXD95PbxvG2H89MZkO6p6fpt47xMynmWpyQtub2/fSkdF9hdYIxyk224w== X-Received: by 2002:a05:6512:320a:: with SMTP id d10mr8544279lfe.587.1616403956552; Mon, 22 Mar 2021 02:05:56 -0700 (PDT) Received: from [192.168.18.170] ([149.126.102.234]) by smtp.gmail.com with ESMTPSA id u12sm105458lff.126.2021.03.22.02.05.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Mar 2021 02:05:55 -0700 (PDT) Subject: Re: Built-in connection pooler To: Zhihong Yu Cc: Daniel Gustafsson , Konstantin Knizhnik , Michael Paquier , David Steele , "ideriha.takeshi@fujitsu.com" , Jaime Casanova , Tomas Vondra , Ryan Lambert , Thomas Munro , PostgreSQL Hackers , Bruce Momjian , Dimitri Fontaine , Alvaro Herrera References: <3edbc4d2-ebe8-d73f-a3f4-e043bc504f17@pgmasters.net> <20200917050711.GK2873@paquier.xyz> <0fd2ee44-e75b-8d14-4192-641aa07d6c89@postgrespro.ru> From: Konstantin Knizhnik Message-ID: <0d9c9165-3389-dd70-3429-df2facce44ec@garret.ru> Date: Mon, 22 Mar 2021 12:05:53 +0300 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-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Thank you for review! On 21.03.2021 23:59, Zhihong Yu wrote: > Hi, > > +          With load-balancing policy postmaster > choose proxy with lowest load average. > +          Load average of proxy is estimated by number of clients > connection assigned to this proxy with extra weight for SSL connections. > > I think 'load-balanced' may be better than 'load-balancing'. Sorry, I am not a native speaker. But it seems to me (based on the articles I have read), then "load-balancing" is more widely used term: https://en.wikipedia.org/wiki/Load_balancing_(computing) > postmaster choose proxy -> postmaster chooses proxy Fixed. > > +          Load average of proxy is estimated by number of clients > connection assigned to this proxy with extra weight for SSL connections. > > I wonder if there would be a mixture of connections with and without SSL. Why not? And what is wrong with it? > > +         Terminate an idle connection pool worker after the specified > number of milliseconds. > > Should the time unit be seconds ? It seems a worker would exist for at > least a second. > Most of other similar timeouts: statement timeout, session timeout... are specified in milliseconds. > + * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group > > It would be better to update the year in the header. Fixed. > > +        * Use then for launching pooler worker backends and report error > > Not sure I understand the above sentence. Did you mean 'them' instead > of 'then' ? Sorry, it is really mistyping. "them" should be used. Fixed.