Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1itbp2-0000Tt-QT for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2020 18:30:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1itbp1-0005Xq-Ko for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2020 18:30:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1itbp1-0005Xi-7n for pgsql-hackers@lists.postgresql.org; Mon, 20 Jan 2020 18:30:47 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1itbow-0000yg-J4 for pgsql-hackers@postgresql.org; Mon, 20 Jan 2020 18:30:46 +0000 Received: by mail-qk1-x744.google.com with SMTP id z76so186109qka.2 for ; Mon, 20 Jan 2020 10:30:42 -0800 (PST) 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:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=uHECIQ1JYSPeaOxMEnXjkOMvTdN3yq73wgmXmHS0TlI=; b=oYE6D/LXOn91PbuwWsfhXYFH/nR1pw0dyeIwl//LF/eMEHGoAP+r5tkFiwU1gN9LY1 MVsxRsguL/BAHK7FPe4QdhbZV4yxEKl0ibs0adHDwimMpUc4GERFMW3guFi/bq5raln/ ctXn9oyAT0lEcDUyEKbD/KJAxiM0C3GiwirOWpW6ZAaRoSRS6FGC89+MgGtzoyMX/Rje ZL+bEi4Fd6cYf5eY4KiKIyf2rPzZSW0WmN057wIuwrBWzyV0V5b26alslI6nNO8pMeu5 1UvzmiRjdDvll0aplpsOZtxtnlx7smVuadqAqfEzW7rJds9UXFBO7FaXcCswUck5jo1I SkjA== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=uHECIQ1JYSPeaOxMEnXjkOMvTdN3yq73wgmXmHS0TlI=; b=di4a+5Od2sQ4at3GDQrxFOPfqJoeOiVeDtuX83s4A/CoGx41D38tVkYkObJGnyPP/p 18VL3wGZx+e/0xA5LDdJrsvwiAjWQIQDOAmRS78Kc5Tve1hjys38sVSK2Lz66+BQOMT5 VmryFbZmiZ+Ij6bfd+Dje3BnGAPFqCMmRpGA1JIk1z31qx9TpaVgbvBfCzJIjgXrZ3PT bHla2YLuSdqeL7BAhEqkfUoSz7JD83hQk2hLig9oV05GKo6XCAwz364V8qAy6uhLcx+x rGkuTVeFGH5zQUY8bmAUL/TBBXxWGgumrU42KYEcLwEw9fU25VkSuQsixqK6bP9nr8hh AnTw== X-Gm-Message-State: APjAAAXlFABRmE3cXTG569YKP4ISqgZCo1k4y7qRdBTTc4xkg8Ki66nr KsBQoiJrvLMz+YSZ919JeCV6ew== X-Google-Smtp-Source: APXvYqx5WavfPPMfJsaLUh+B5kv9FB91dj8q5xy0NOAnj9E+1btAfL+3QFoMYPrvV8X8DiZT+8DsAw== X-Received: by 2002:a37:6706:: with SMTP id b6mr789905qkc.461.1579545040703; Mon, 20 Jan 2020 10:30:40 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([201.186.208.119]) by smtp.gmail.com with ESMTPSA id k21sm17741902qtp.92.2020.01.20.10.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 10:30:39 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 3CC32300A3A; Mon, 20 Jan 2020 15:01:36 -0300 (-03) Date: Mon, 20 Jan 2020 15:01:36 -0300 From: Alvaro Herrera To: Tomas Vondra Cc: "tsunakawa.takay@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: SLRU statistics Message-ID: <20200120180136.GA28405@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200120163754.mbbkbhzaummlo47c@development> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Jan-20, Tomas Vondra wrote: > On Mon, Jan 20, 2020 at 01:04:33AM +0000, tsunakawa.takay@fujitsu.com wrote: > > From: Tomas Vondra > > > One of the stats I occasionally wanted to know are stats for the SLRU > > > stats (we have couple of those - clog, subtrans, ...). So here is a WIP > > > version of a patch adding that. > > > > How can users take advantage of this information? I think we also need > > the ability to set the size of SLRU buffers. (I want to be freed from > > the concern about the buffer shortage by setting the buffer size to its > > maximum. For example, CLOG would be only 1 GB.) > > You're right the users can't really take advantage of this - my primary > motivation was providing a feedback for devs, benchmarking etc. That > might have been done with DEBUG messages or something, but this seems > more convenient. I think the stats are definitely needed if we keep the current code. I've researched some specific problems in this code, such as the need for more subtrans SLRU buffers; IIRC it was pretty painful to figure out what the problem was without counters, and it'd have been trivial with them. > I think it's unclear how desirable / necessary it is to allow users to > tweak those caches. I don't think we should have a GUC for everything, > but maybe there's some sort of heuristics to determine the size. The > assumption is we actually find practical workloads where the size of > these SLRUs is a performance issue. I expect we'll eventually realize the need for changes in this area. Either configurability in the buffer pool sizes, or moving them to be part of shared_buffers (IIRC Thomas Munro had a patch for this.) Example: SLRUs like pg_commit and pg_subtrans have higher buffer consumption as the range of open transactions increases; for many users this is not a concern and they can live with the default values. (I think when pg_commit (née pg_clog) buffers were increased, we should have increased pg_subtrans buffers to match.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services