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 1kXaOZ-0005hE-Vo for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Oct 2020 01:37:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXaOY-0000ze-U3 for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Oct 2020 01:36:58 +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 1kXaOY-0000zR-Is for pgsql-hackers@lists.postgresql.org; Wed, 28 Oct 2020 01:36:58 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kXaOV-0006ez-QQ for pgsql-hackers@postgresql.org; Wed, 28 Oct 2020 01:36:57 +0000 Received: by mail-ed1-x542.google.com with SMTP id l24so3429037edj.8 for ; Tue, 27 Oct 2020 18:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zgJyPi5j+Uk48cBwuRX/ayiTo+eYXY80JVcnt/MmNVU=; b=XhbxBkNtMkNQ2NLjDSJH9Bmo1RvomeKRQw2NriRJH9Cax8BgcmN4NZPi+iiVWM9Kbr vyyqedyhSDlRChm9CpVR6+amv0rZB9qUAmQIPfLH+p8qd1wLOMz1z4AINBLK1E2nwy4a onFbcpqtSqT3DRbJXeiuG2YBjq2EsIMQHp1xzioxstI3mq94B88ddlizpb0Mrkb86LXf ElsjkAd/uNukcxYdVJ04s4U1D7Fyh3WHbCEMNa7coWV9jkalyBE2RLe9pRTLavC/4V+O xL/B4Z7Jag/OmMWvseSTruPdqK5JtcpXl5Rgu/SZ+g4GMlRPHaX/UKdg6T8KKmi2gcdd UinA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zgJyPi5j+Uk48cBwuRX/ayiTo+eYXY80JVcnt/MmNVU=; b=VpHbkDvG0yhgtaSKAMgKBIF0LqTweescptAy6X54VtCsah7fuUpMmnl2AjlpMDEVVF t2u9FosmuL/6uTjZuwmA57cTr2Qrr2WC4bryb9YstDB+Dp5NTUxIlYUT2n07ln+m4mod Z6MLyLtn14vRln1a7aW3825GbsYfparCyqb6zssoVUu7hJecimvCursRmuxjlalPBR6w JoWiNB9OygI2H2DQ1U2++i/yFGS6mEHVOuwKgLV4l6ZuSssHh89inT7Oniabm7Um24ii 6q0vKbwZNNRtYWxz8B7ZJqZ9STBwx9D4FLdkWhJHNm6DPfq2ZnD1t/MtalK+86aejjqq fMWA== X-Gm-Message-State: AOAM531RJPuclDgsz1freVRlMaF6wuytFT1c1P6Lj73PXu3VlWjNU8Xg RJvqzkJXX4NCkQkAsY2PqeWKug== X-Google-Smtp-Source: ABdhPJyxPM5Zqv5n7SVP6rayT912cTcmspY36X/OIdFz1UOhwn3+wdxwpEa+OMv0freBizAy5xogIA== X-Received: by 2002:a05:6402:943:: with SMTP id h3mr5279129edz.88.1603849014271; Tue, 27 Oct 2020 18:36:54 -0700 (PDT) Received: from localhost (ip-86-49-245-76.net.upcbroadband.cz. [86.49.245.76]) by smtp.gmail.com with ESMTPSA id w25sm1959731ejy.123.2020.10.27.18.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 18:36:53 -0700 (PDT) Date: Wed, 28 Oct 2020 02:36:51 +0100 From: Tomas Vondra To: Alexander Korotkov Cc: Andrey Borodin , Anastasia Lubennikova , Daniel Gustafsson , Kyotaro Horiguchi , pgsql-hackers Subject: Re: MultiXact\SLRU buffers configuration Message-ID: <20201028013651.de5cj2xadgmba5nf@development> References: <102F673B-C9C5-4823-A92F-96799FC61ED0@yandex-team.ru> <20200515.090333.24867479329066911.horikyota.ntt@gmail.com> <2ECE132B-C042-4489-930E-DBC5D0DAB84A@yandex-team.ru> <2087E87D-44CA-4443-8E6A-5087F07443F4@yandex-team.ru> <8A94938B-054C-4439-9866-2C220B4D0DD7@yandex-team.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Oct 27, 2020 at 08:23:26PM +0300, Alexander Korotkov wrote: >On Tue, Oct 27, 2020 at 8:02 PM Alexander Korotkov wrote: >> On Mon, Oct 26, 2020 at 6:45 PM Andrey Borodin wrote: >> > Thanks for your review, Alexander! >> > +1 for avoiding double locking in SimpleLruReadPage_ReadOnly(). >> > Other changes seem correct to me too. >> > >> > >> > I've tried to find optimal value for cache size and it seems to me that it affects multixact scalability much less than sizes of offsets\members buffers. I concur that patch 2 of the patchset does not seem documented enough. >> >> Thank you. I've made a few more minor adjustments to the patchset. >> I'm going to push 0001 and 0003 if there are no objections. > >I get that patchset v5 doesn't pass the tests due to typo in assert. >The fixes version is attached. > I did a quick review on this patch series. A couple comments: 0001 ---- This looks quite suspicious to me - SimpleLruReadPage_ReadOnly is changed to return information about what lock was used, merely to allow the callers to do an Assert() that the value is not LW_NONE. IMO we could achieve exactly the same thing by passing a simple flag that would say 'make sure we got a lock' or something like that. In fact, aren't all callers doing the assert? That'd mean we can just do the check always, without the flag. (I see GetMultiXactIdMembers does two calls and only checks the second result, but I wonder if that's intended or omission.) In any case, it'd make the lwlock.c changes unnecessary, I think. 0002 ---- Specifies the number cached MultiXact by backend. Any SLRU lookup ... should be 'number of cached ...' 0003 ---- * Conditional variable for waiting till the filling of the next multixact * will be finished. See GetMultiXactIdMembers() and RecordNewMultiXact() * for details. Perhaps 'till the next multixact is filled' or 'gets full' would be better. Not sure. This thread started with a discussion about making the SLRU sizes configurable, but this patch version only adds a local cache. Does this achieve the same goal, or would we still gain something by having GUCs for the SLRUs? If we're claiming this improves performance, it'd be good to have some workload demonstrating that and measurements. I don't see anything like that in this thread, so it's a bit hand-wavy. Can someone share details of such workload (even synthetic one) and some basic measurements? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services