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 1nAZcY-0007vO-A2 for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jan 2022 15:45:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAZcW-0000Nc-F4 for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jan 2022 15:45:04 +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 1nAZcW-0000NS-2c for pgsql-hackers@lists.postgresql.org; Thu, 20 Jan 2022 15:45:04 +0000 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAZcT-0005Wo-0E for pgsql-hackers@postgresql.org; Thu, 20 Jan 2022 15:45:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1642693502; x=1674229502; h=date:from:to:cc:message-id:references:mime-version: in-reply-to:subject; bh=Gm1BmUQ0TeSjq+4GLGskgmLCCwgiKYwifpbSWxSpdBw=; b=CiThSw+42+76cpgSXXkpLwsIsOT2XQnqXq1j+SYusgx019HiV//PtoN/ FDNqhKOlZR8DyVRrI5ripKzEzqzy9uOhf+GPueNBc0S2Nx07qQdknCmDp nKQ3fNxZPq+ra5r6EPHmlROfXOWqOGDGwCpzWLMVunF2pojcmjWlLSa+F s=; X-IronPort-AV: E=Sophos;i="5.88,302,1635206400"; d="scan'208";a="171789930" Subject: Re: MultiXact\SLRU buffers configuration Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-10222bbc.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP; 20 Jan 2022 15:45:00 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1d-10222bbc.us-east-1.amazon.com (Postfix) with ESMTPS id DD5F71A1332; Thu, 20 Jan 2022 15:44:56 +0000 (UTC) Received: from EX13D05UWC002.ant.amazon.com (10.43.162.92) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Thu, 20 Jan 2022 15:44:56 +0000 Received: from f01898859afd.ant.amazon.com (10.43.160.209) by EX13D05UWC002.ant.amazon.com (10.43.162.92) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Thu, 20 Jan 2022 15:44:55 +0000 Date: Thu, 20 Jan 2022 07:44:54 -0800 From: Shawn Debnath To: Andrey Borodin CC: Julien Rouhaud , Gilles Darold , Tomas Vondra , Tomas Vondra , Alexander Korotkov , Anastasia Lubennikova , Daniel Gustafsson , Kyotaro Horiguchi , pgsql-hackers , Thomas Munro Message-ID: References: <15CA416B-3446-462D-902B-4883DD3ADEE6@yandex-team.ru> <494C5E7F-E410-48FA-A93E-F7723D859561@yandex-team.ru> <28051640513399@vla1-36b7415cbc1b.qloud-c.yandex.net> <20220114092838.gbr6ea7zxbaespsr@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.43.160.209] X-ClientProxiedBy: EX13D14UWB001.ant.amazon.com (10.43.161.158) To EX13D05UWC002.ant.amazon.com (10.43.162.92) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Jan 15, 2022 at 12:16:59PM +0500, Andrey Borodin wrote: > > I was planning on running a set of stress tests on these patches. Could > > we confirm which ones we plan to include in the commitfest? > > Many thanks for your interest. Here's the latest version. Here are the results of the multixact perf test I ran on the patch that splits the linear SLRU caches into banks. With my test setup, the binaries with the patch applied performed slower marginally across the test matrix against unpatched binaries. Here are the results: +-------------------------------+---------------------+-----------------------+------------+ | workload | patched average tps | unpatched average tps | difference | +-------------------------------+---------------------+-----------------------+------------+ | create only | 10250.54396 | 10349.67487 | -1.0% | | create and select | 9677.711286 | 9991.065037 | -3.2% | | large cache create only | 10310.96646 | 10337.16455 | -0.3% | | large cache create and select | 9654.24077 | 9924.270242 | -2.8% | +-------------------------------+---------------------+-----------------------+------------+ The test was configured in the following manner: - AWS EC2 c5d.24xlarge instances, located in the same AZ, were used as the database host and the test driver. These systems have 96 vcpus and 184 GB memory. NVMe drives were configured as RAID5. - GUCs were changed from defaults to be the following: max_connections = 5000 shared_buffers = 96GB max_wal_size = 2GB min_wal_size = 192MB - pgbench runs were done with -c 1000 -j 1000 and a scale of 10,000 - Two multixact workloads were tested, first [0] was a create only script which selected 100 pgbench_account rows for share. Second workload [1] added a select statement to visit rows touched in the past which had multixacts generated for them. pgbench test script [2] wraps the call to the functions inside an explicit transaction. - Large cache tests are multixact offsets cache size hard coded to 128 and members cache size hard coded to 256. - Row selection is based on time based approach that lets all client connections coordinate which rows to work with based on the millisecond they start executing. To allow for more multixacts to be generated and reduce contention, the workload uses offsets ahead of the start id based on a random number. - The one bummer about these runs were that they only ran for 600 seconds for insert only and 400 seconds for insert and select. I consistently ran into checkpointer getting oom-killed on this instance after that timeframe. Will dig into this separately. But the TPS was consistent. - Each test was repeated at least 3 times and the average of those runs were used. - I am using the master branch and changes were applied on commit f47ed79cc8a0cfa154dc7f01faaf59822552363f I think patch 1 is a must-have. Regarding patch 2, I would propose we avoid introducing more complexity into SimpleLRU cache and instead focus on making the SLRU to buffer cache effort [3] a reality. I would also add that we have a few customers in our fleet who have been successfully running the large cache configuration on the regular SLRU without any issues. With cache sizes this small, the linear searches are still quite efficient. If my test workload can be made better, please let me know. Happy to re-run tests as needed. [0] https://gist.github.com/sdebnath/e015561811adf721dd40dd6638969c69 [1] https://gist.github.com/sdebnath/2f3802e1fe288594b6661a7a59a7ca07 [2] https://gist.github.com/sdebnath/6bbfd5f87945a7d819e30a9a1701bc97 [3] https://www.postgresql.org/message-id/CA%2BhUKGKAYze99B-jk9NoMp-2BDqAgiRC4oJv%2BbFxghNgdieq8Q%40mail.gmail.com -- Shawn Debnath Amazon Web Services (AWS)