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 1itc3f-00012U-Bv for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2020 18:45:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1itc3e-0005G1-4H for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2020 18:45:54 +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 1itc3d-0005Fu-RU for pgsql-hackers@lists.postgresql.org; Mon, 20 Jan 2020 18:45:53 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1itc3Y-00018q-Rl for pgsql-hackers@postgresql.org; Mon, 20 Jan 2020 18:45:53 +0000 Received: by mail-wm1-x344.google.com with SMTP id p17so392774wma.1 for ; Mon, 20 Jan 2020 10:45:48 -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:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=2j4rYl1+zE4g3CAHTTLAS5x5C88DI4puNefRC4PifgU=; b=NXUgXVVWz/HkstuemKVzTEfAlbLgB8VNDkDrLXEuOoF53ph3b4e7rjtyKFfQlEY14p caAHnsjwdj/jkL4jLZyyeoAxDXLzDI1jLZ5oApvJkdXQ2YPVYptqYl2TETiy8YfhBkGe 7T9AL3FZFRTIjx3/GQECYfPzwWbpOcwK53Xr7W7LVSRYVBBUP3voyhvQw+7JKRgo2rSI XehhbU0mdWrLt0Xtfb4hooODE5bsG1x/oLVT3YawkqcryYJVpVtrw0VQy9MiOaJB43JK NAz2KFzvUdi8joBmDSRun80Wsq1bFGTBN2YLKOEQElcn+oAq70CvzirFlGcOLnlUJIaU hUlw== 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=2j4rYl1+zE4g3CAHTTLAS5x5C88DI4puNefRC4PifgU=; b=AK4eHt/J0ARtdYj5tSGLmdwhxI1RS66t9TTZV74n2TIXl3cAiyP6I75WR5tku4mx8z tFf7h1wEbBGvH02/kUkhEvqL5kYLYn8GO5qt7KAMMfp8eVg4ITJjDvQNsuT472lAWITQ V8GK9os72cDGCXZw/8QPzTsHsx8vlpNbfiGfpaNR4oLxtptYiuZsPAc7kvZhCOwC/c7y ZJW34UR0+V8dQZ/R9NBnim6E7kELR1OdIjAnfOJoHM/CCAZkBp2yA4o2PjniwWZDVqT6 56aCnJfhFb0OsScMxYD3DkOze7tnlTfXkmB1RyXNKRUSz9dM07vhFTtCk/ZU5j0QajBQ SWtA== X-Gm-Message-State: APjAAAUjyjJRNJf0kxLvs4ZOc1bo+oQM/fdwcDXs8SNeEZ35kigY7ssI wsdjwU45CVyiahOpJFcExCSqu+BPXF0= X-Google-Smtp-Source: APXvYqyEJUHkV7NbCYEE21DJP58TI+zYDgwqTGZotd2g4/fQQlljwS1TQfjmKkBeCsYklJ9ZiM0EXw== X-Received: by 2002:a7b:cd87:: with SMTP id y7mr234225wmj.189.1579545947906; Mon, 20 Jan 2020 10:45:47 -0800 (PST) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id x6sm308231wmi.44.2020.01.20.10.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 10:45:47 -0800 (PST) Date: Mon, 20 Jan 2020 19:45:46 +0100 From: Tomas Vondra To: Alvaro Herrera Cc: "tsunakawa.takay@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: SLRU statistics Message-ID: <20200120184546.drmg5u4fnaw2v2rk@development> References: <20200120163754.mbbkbhzaummlo47c@development> <20200120180136.GA28405@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200120180136.GA28405@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jan 20, 2020 at 03:01:36PM -0300, Alvaro Herrera wrote: >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. > Right. Improving our ability to monitor/measure things is the goal of this patch. >> 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.) > Quite possibly, yes. All I'm saying is that it's not something I intend to address with this patch. It's quite possible the solutions will be different for each SLRU, and that will require more research. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services