Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfmo0-0001h2-Dp for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Sep 2016 11:38:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bfmnz-0003Au-SV for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Sep 2016 11:38:43 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bfmny-0003AH-V0 for pgsql-hackers@postgresql.org; Fri, 02 Sep 2016 11:38:43 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfmnv-0007Is-Pp for pgsql-hackers@postgresql.org; Fri, 02 Sep 2016 11:38:42 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 3DC7021C26B8; Fri, 2 Sep 2016 14:38:39 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7B5lwwlM5PnS; Fri, 2 Sep 2016 14:38:39 +0300 (MSK) Received: from [192.168.27.88] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id C126321C26AF; Fri, 2 Sep 2016 14:38:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1472816319; bh=T0IhaodbMF6s3wJ92IfYCKcYAa1nPaiLKK6myiNzhug=; h=From:Subject:To:References:Cc:Date:In-Reply-To; b=ThooHPk5/8tT3tzN81l03upfoBJNt5fW3cwUktUWYNSKfm+ZlaSkMebSOLEs5lJ7F lUUaepLraIc/lvvcToCw2twD51j1UCzYECtOsuMD+8CzUAk6POln8c5OzL3EqHIcxe /TQRcxVw+sxRLQy3t7++ox8M1cwlNZwgIeX+BzIU= From: Ivan Kartyshov Subject: Re: less expensive pg_buffercache on big shmem To: Robert Haas References: Cc: "pgsql-hackers@postgresql.org" Message-ID: <479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru> Date: Fri, 2 Sep 2016 14:38:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.5 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 09/02/2016 06:01 AM, Robert Haas wrote: > I wonder whether we ought to just switch from the consistent method to > the semiconsistent method and call it good. I agree with you that > taking every buffer partition lock simultaneously seems like too much > locking. And in the future if we replace the buffer mapping hash with > something that is lock-free or close to it, then we wouldn't even have > buffer partition locks any more, and probably no way at all to get an > entirely consistent snapshot. > What do you think of this? I fully agree with you that it would be preferred in the future to replace the buffer mapping hash with some of lock-free algorithms. In the question of replacing the consistent method I agree with you, Andres Freund and Peter Geoghegan: the consistent method does not bring any considerable benefits. You might be right regarding the three different modes, but our DBAs asked if we could preserve a legacy mode too, thus the choice. On 09/02/2016 06:19 AM, Andres Freund wrote: > +1. I think, before long, we're going to have to switch away from having > locks & partitions in the first place. So I don't see a problem relaxing > this. It's not like that consistency really buys you anything... I'd > even consider not using any locks. If we will replace consistent method, then we should replace it with the partially consistent method (called "nonconsistent") because: 1) it's based on fast spinlocks (it's not fully up to its name, though) 2) it's *almost* the fastest one (the less time needed for execution of method, the less data core will change and as a consequence the more consistent snapshot will be) 3) and it has less influence on the entire system during query processing. On 09/02/2016 06:30 AM, Peter Geoghegan wrote: > I would like to be able to run pg_buffercache in production from time > to time. Yes, in our experience the usage of fully consistent pg_buffercache in production is quite a courageous decision. --- Ivan Kartyshov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers