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 1liPUh-0003qG-NQ for pgsql-bugs@arkaria.postgresql.org; Sun, 16 May 2021 22:44:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1liPUg-0004IF-Il for pgsql-bugs@arkaria.postgresql.org; Sun, 16 May 2021 22:44:18 +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 1liPUg-0004Hs-CN for pgsql-bugs@lists.postgresql.org; Sun, 16 May 2021 22:44:18 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liPUe-0005Fh-Er for pgsql-bugs@lists.postgresql.org; Sun, 16 May 2021 22:44:18 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CEA735C01D0; Sun, 16 May 2021 18:44:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 16 May 2021 18:44:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=HoZSKzJBISTXApGUIM5iWHHvELg FvubvD+GuO1Zoe+Q=; b=NisnSh0l55Iotvzt2kXWQmE+FO2N6rc8UG69JcoWbKI LH7pItB3jWpOlsxrAsvgmPgXR+OZGFZ/OXy9bWxwE5mgTAuSnPvkbENX15wDF9Nv tfVQivfXMMFCO1fN9GuLf77fb9tpToFx5thPsfppo5y6tKCyZMkL0xHGjZaGFH90 r40m4rVqeIs4s5j/sOZEy8C2E1Avp824BoG3PYGDcrDWNKFx0j6p9UvaIh8/Q0Eu +3x0noaGUXRIxgQ0YlS2U4O/whK3VsdwTVrjt1OPnp9UMZi7p0Gg0GTfy9xI98M9 jFkd9+MOKHPreLR7OGbsVMIqYqQLJibrKd28RxYa1Ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=HoZSKz JBISTXApGUIM5iWHHvELgFvubvD+GuO1Zoe+Q=; b=U6KNV2WwD0ihea4pABvQBr ORrLhRNwUfXu/lqMqbEcdB6B/cYt/+9x56FlvV2xc/25EKwGd+RmD71VMAoTWaDr k/9wOvBa3qncvFjP++EYFLoCAPu/VA1G30Zn5VLLagGIDscgyzjKBhQisAno9vlm QAR0yNBf/kTi7QKxDAEFhfSoAuJZ6qwxBfYokhEZG0T3feHIS66l7cUE+PLJoatt MkCS38WY2DNNYtFdxHNwyWLdQ/cr3ktZ9Qgul/oU6AnDuLIxWSxnnGXx0KP29GW7 kvwT/ixBVsknLjw31Qfn+EHM0qY4et7j4FCkPqZhYXLpSbN5l+/PwHHoTa5urQfg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeigedgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghn rghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepudekhfekleeugeevteehleffff ejgeelueduleeffeeutdelffeujeffhfeuffdunecukfhppedutdejrddugedvrdeffedr uddtfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: from intern.anarazel.de (107-142-33-103.lightspeed.sntcca.sbcglobal.net [107.142.33.103]) by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 16 May 2021 18:44:14 -0400 (EDT) Date: Sun, 16 May 2021 15:44:13 -0700 From: Andres Freund To: rony.kurniawan@oracle.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17005: Enhancement request: Improve walsender throughput by aggregating multiple messages in one send Message-ID: <20210516224413.xitbilinlyrlt42m@alap3.anarazel.de> References: <17005-3e1030784d5440c4@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17005-3e1030784d5440c4@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-05-13 00:31:53 +0000, PG Bug reporting form wrote: > I measured the throughput of reading the logical replication slot and found > that in smaller row size (512 bytes) the throughput is 50% lower compared to > 1024 bytes. Huh, that is interesting. > tcpdump shows that ethernet packets sent by the replication server contain > only one message per packet (see tcpdump output below). > May be this is the intended design to achieve low latency but this is not > favorable in application that requires high throughput. What kind of network is this? I would have expected that if the network can't keep up the small sends would end up getting aggregated into larger packets anyway? Are you hitting a PPS limit due to the small packages, but not yet the throughput limit? > Is it possible for PostgreSQL to enable Nagle's algorithm on the streaming > socket for replication? > Or aggegate the messages manually before sending them in one send()? I think we can probably do better in cases a transaction is more than a single change - but I don't think either enabling nagle's or aggregation are really an option in case of single row transactions. The latency impact for some scenarios seems too high. Greetings, Andres Freund