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 1puHTn-0008A0-3P for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2023 18:45:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puHSn-00038i-4w for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2023 18:44:29 +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 1puHSm-00038Y-Ru for pgsql-hackers@lists.postgresql.org; Wed, 03 May 2023 18:44:28 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1puHSh-000OL2-Np for pgsql-hackers@postgresql.org; Wed, 03 May 2023 18:44:27 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 706745C0160; Wed, 3 May 2023 14:44:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 03 May 2023 14:44:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1683139461; x=1683225861; bh=aJ KTmUqUHuPD3CjvSAbhzO49a250nxKYKqd/iXe3xag=; b=UI7tzWs0o1pD29sxa+ 7cqRPP8FXqwyM/i+okeD5/YVbaFceJewhfPWC+4tjuNEg/HIxdEJ6Q4rIH+HxGR8 P5YtX+YeKTK/VGagAlBt6/gHEUYcXp4s8uKkOgAGjPp0JDpmiYh/tTInQ8vzbM/G 444HVEwMAuL8jWgjbQHqhTkzdRe3diVyjJZ7baaxLEvZs99iuLElofWV6A2ncMDu oMh3856jtgUGmFLAriPAspGJRYi0YAGf8aCRQUP7XmbCEtM2QxzxEXdB0wiy5XKL r7tT6VR8cNisrQygFDZHXnyBXWGHcIIgdDP5LeR0JmYVMNeUzpzOZL9Wa/ERtGyD hLVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1683139461; x=1683225861; bh=aJKTmUqUHuPD3 CjvSAbhzO49a250nxKYKqd/iXe3xag=; b=CQYaoyw8rxRNI2kNf7batqiCFKDEI Gvj7F93Y9c//DaRLrxSmcAYxXIc0eQth+nnnACDN6UwtmA473Yv3jjZT4rxYD9sP 5Az+PM5406wLjs9iddwbER1W7gGoP9h7zJ93Y+emxSsPQm/G6DSWzqEs6ymzCDhm VGXu/r0ffuijGw1rl/cae9lyExjw0oy0pl+y/8/9M86/mMDcenJTiJ/em4a4L43d eQp9Hu/LfCmFa81KxdFf9C6ukuUBevFp4xCHtnSLh0lU4+Ghx2q8QHy+W718gadg WLoRkd05ZvKIRJwsd2gGKoD51beLAaQt+wA4oLENztvTLSkLIW6wJNWwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvkedguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteev udeitedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 May 2023 14:44:20 -0400 (EDT) Date: Wed, 3 May 2023 11:44:19 -0700 From: Andres Freund To: Muhammad Malik Cc: "pgsql-hackers@postgresql.org" , Thomas Munro , Melanie Plageman , Yura Sokolov , Robert Haas Subject: Re: refactoring relation extension and BufferAlloc(), faster COPY Message-ID: <20230503184419.vxwtcabkqweef2wi@awork3.anarazel.de> References: <20221029025420.eplyow6k7tgu6he3@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-05-03 18:25:51 +0000, Muhammad Malik wrote: > Could you please share repro steps for running these benchmarks? I am doing performance testing in this area and want to use the same benchmarks. The email should contain all the necessary information. What are you missing? c=16;psql -c 'DROP TABLE IF EXISTS copytest_0; CREATE TABLE copytest_0(data text not null);' && time /srv/dev/build/m-opt/src/bin/pgbench/pgbench -n -P1 -c$c -j$c -t$((1024/$c)) -f ~/tmp/copy.sql && psql -c 'TRUNCATE copytest_0' > I've done a fair bit of benchmarking of this patchset. For COPY it comes out > ahead everywhere. It's possible that there's a very small regression for > extremly IO miss heavy workloads, more below. > > > server "base" configuration: > > max_wal_size=150GB > shared_buffers=24GB > huge_pages=on > autovacuum=0 > backend_flush_after=2MB > max_connections=5000 > wal_buffers=128MB > wal_segment_size=1GB > > benchmark: pgbench running COPY into a single table. pgbench -t is set > according to the client count, so that the same amount of data is inserted. > This is done oth using small files ([1], ringbuffer not effective, no dirty > data to write out within the benchmark window) and a bit larger files ([2], > lots of data to write out due to ringbuffer). I use a script like: c=16;psql -c 'DROP TABLE IF EXISTS copytest_0; CREATE TABLE copytest_0(data text not null);' && time /srv/dev/build/m-opt/src/bin/pgbench/pgbench -n -P1 -c$c -j$c -t$((1024/$c)) -f ~/tmp/copy.sql && psql -c 'TRUNCATE copytest_0' > [1] COPY (SELECT repeat(random()::text, 5) FROM generate_series(1, 100000)) TO '/tmp/copytest_data_text.copy' WITH (FORMAT test); > [2] COPY (SELECT repeat(random()::text, 5) FROM generate_series(1, 6*100000)) TO '/tmp/copytest_data_text.copy' WITH (FORMAT text); Greetings, Andres Freund