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 1kXuw4-0000Q2-FV for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Oct 2020 23:32:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXuw3-0007NU-9F for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Oct 2020 23:32:55 +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 1kXuw3-0007NN-2O for pgsql-hackers@lists.postgresql.org; Wed, 28 Oct 2020 23:32:55 +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 1kXuvw-0000Xc-At for pgsql-hackers@postgresql.org; Wed, 28 Oct 2020 23:32:54 +0000 Received: by mail-ed1-x542.google.com with SMTP id v4so1313727edi.0 for ; Wed, 28 Oct 2020 16:32:48 -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:content-transfer-encoding:in-reply-to; bh=ZV+G8TM2j7Gd3vMdqFC3aNpV+tpDTY96ASCyoSCXQN4=; b=IKfN/NKlDznPUrYndWsQC3sl8PDhLKcGtkcLAku17LmSG69NXghquPEm5C9sN7MYoV BgvzJ/Hhuus/Ri6MKF8nBkTHFSs5PLknT8N615RnifmAdVqa9W7zoMcWAPWL/zOpTvZz Jfo5q82gdkWP9plumOLV15POLyybxWoewy8QIOzQOTT+pIGnusQ4TVIuCHntnfxQQG3z VWx7Z78onrdIr9JHHXoF++rAHZATtVoqBZxdhx/ck60Z9laGYyhf1Fohg3NPdaDKvrWD wz3AC9PHiOjB0nmIaWMtQYo+Ni471xu/LFeakMUhRK6LLZ7q1DfCWxLmlsctYszY2k9d zBrA== 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:content-transfer-encoding :in-reply-to; bh=ZV+G8TM2j7Gd3vMdqFC3aNpV+tpDTY96ASCyoSCXQN4=; b=fz4crMK3Qd3Z43CJyLuP6DaisfiAzgGwLiIZ12ugaA4esWLARppKkARPiMRNIYeuYN rBdGnp+cWJQ0EO4AfIexXZBXQHxggiD+pXvTV5yvIDhXzgYHKTJIjZpary8GKhq01YGY qK6I7q+Er1iRK9Gif/9og4f17CFDFx/jVmBDys1YI4Mb0rLEWjMLy66NHjC6P11/rPjc g3pIwseiSZxbhTCHuLdabDSkQqOxk+tjJrWquP3Nf9G/+Wd+yoVTnAZoOqYcuWEMXkCp 2VzhClfR0TkZt+5+27Gk02kxtRp1KNkiuA0ne35a4mGgMWnnYGvvjZcq0GWzkyUGbpiN Uy+g== X-Gm-Message-State: AOAM530BtlFfDU2rS+Onk6cQVug5zoUSjZT+F8B+EfHz/d2Ah2TwmVbB o24ThFxW2sATmSmGT0L0eLQ0fg== X-Google-Smtp-Source: ABdhPJzKtukfXthu2QU6lubOkOe/ip+xKx6gxhMi/h4XDwyk9el2xLZt0gz4S1Us/iMm4a9shg9rhg== X-Received: by 2002:a50:decd:: with SMTP id d13mr1378452edl.202.1603927966717; Wed, 28 Oct 2020 16:32:46 -0700 (PDT) Received: from localhost (ip-86-49-245-76.net.upcbroadband.cz. [86.49.245.76]) by smtp.gmail.com with ESMTPSA id k26sm543877edf.85.2020.10.28.16.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 16:32:46 -0700 (PDT) Date: Thu, 29 Oct 2020 00:32:43 +0100 From: Tomas Vondra To: Andrey Borodin Cc: Alexander Korotkov , Anastasia Lubennikova , Daniel Gustafsson , Kyotaro Horiguchi , pgsql-hackers Subject: Re: MultiXact\SLRU buffers configuration Message-ID: <20201028233243.ygm6yqlynkqpzekr@development> References: <2ECE132B-C042-4489-930E-DBC5D0DAB84A@yandex-team.ru> <2087E87D-44CA-4443-8E6A-5087F07443F4@yandex-team.ru> <8A94938B-054C-4439-9866-2C220B4D0DD7@yandex-team.ru> <20201028013651.de5cj2xadgmba5nf@development> <13D8FD63-559A-4737-B7FD-05288D1CEF8B@yandex-team.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <13D8FD63-559A-4737-B7FD-05288D1CEF8B@yandex-team.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On Wed, Oct 28, 2020 at 12:34:58PM +0500, Andrey Borodin wrote: >Tomas, thanks for looking into this! > >> 28 окт. 2020 г., в 06:36, Tomas Vondra написал(а): >> >> >> 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? > >All patches in this thread aim at the same goal: improve performance in presence of MultiXact locks contention. >I could not build synthetical reproduction of the problem, however I did some MultiXact stressing here [0]. It's a clumsy test program, because it still is not clear to me which parameters of workload trigger MultiXact locks contention. In generic case I was encountering other locks like *GenLock: XidGenLock, MultixactGenLock etc. Yet our production system encounters this problem approximately once in a month through this year. > >Test program locks for share different set of tuples in presence of concurrent full scans. >To produce a set of locks we choose one of 14 bits. If a row number has this bit set to 0 we add lock it. >I've been measuring time to lock all rows 3 time for each of 14 bits, observing total time to set all locks. >During the test I was observing locks in pg_stat_activity, if they did not contain enough MultiXact locks I was tuning parameters further (number of concurrent clients, number of bits, select queries etc). > >Why is it so complicated? It seems that other reproductions of a problem were encountering other locks. > It's not my intention to be mean or anything like that, but to me this means we don't really understand the problem we're trying to solve. Had we understood it, we should be able to construct a workload reproducing the issue ... I understand what the individual patches are doing, and maybe those changes are desirable in general. But without any benchmarks from a plausible workload I find it hard to convince myself that: (a) it actually will help with the issue you're observing on production and (b) it's actually worth the extra complexity (e.g. the lwlock changes) I'm willing to invest some of my time into reviewing/testing this, but I think we badly need better insight into the issue, so that we can build a workload reproducing it. Perhaps collecting some perf profiles and a sample of the queries might help, but I assume you already tried that. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services