Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1zCr-0004DH-6R for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Nov 2016 17:20:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c1zCq-0005QE-PO for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Nov 2016 17:20:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c1zBR-0002Ul-JM for pgsql-hackers@postgresql.org; Wed, 02 Nov 2016 17:18:41 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1c1zBK-0000bu-Mp for pgsql-hackers@postgresql.org; Wed, 02 Nov 2016 17:18:40 +0000 Received: by mail-wm0-x22c.google.com with SMTP id t79so51063166wmt.0 for ; Wed, 02 Nov 2016 10:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=kRENXe+of758w4ofUWO5bB7+YqCKSwPRp8MhrmtGgyw=; b=GgGL3z7+H0WgapElkonG+6oovK+RDX2izumQO4UhqdY/gie0tvXbb2dWu4awm6wIZj 77jgzMJDnXG3kUk3SSD9Qx0Qfz0VYAT7AEtAnHMRRLxT3c3aclTHpKYOV6z78KKQHhU4 vZ5gW87CT4gjuvJO7PTb1FHyMTdPL88hn2rAvwAE+ROGg22Ypi6mOqSeSZorjiYDFAiO bXEF2z5rwjPMSdegfNroMU0ZWi/fGeA0CmmnJQSKmRU7tf1A9A8FBJ2Tz3Vc9D918PLJ dp+sKKzQmbWQnznEywJCbjoEaj9YJOCMfRMz34lmMNtj75bZsE9TJzzgDlNGeNLRhmjb qfTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=kRENXe+of758w4ofUWO5bB7+YqCKSwPRp8MhrmtGgyw=; b=EYgzq7cp1xflU4sfuhKIg2ZaD51KEUMBz9xdONImWpwcaO/QV8WiNPL/qb/2ySNhOs AwgMFP6m+h2QSvxhtSA4cR0uWnjRmcwz3NCh5Q5EgUzeM1qksxbfDont8/U+sGLdFPwG rz7L/gr+zXdB8/qus/zdCZIko3ZL7Ls755XsbbA3OHokUVcQKcGRceOQ5bSYJiKHwb66 /H9WRW9dn0IzsdtpNJ+AvYMDPAsZGL6wsYxMA0sF1zRsri016YOVbA92Eu1YtF6+Bedx 55RRXj+mhu4BBxda2bScbiCm46hN62fAhDHq/eiMqHUX2t0zVLNTHNC8MDHvUNHt2Z6y Ymew== X-Gm-Message-State: ABUngvf0725cKhuBFvXHfEQLP9ObnGHHF1mX53nhVeLPamoDZH7jaaT67SExYVKNaNGWOBVNG+NnM4We1AcAmjizjVq9inO7D9ZAWHjU36mzrJg6xBNpdsDSSzoXejLzWKsJpj+uHhVjVSQGX9pFY0iWQQRLYR2tmHE4e9daAp+xd7oCEem2wo2Pj1+Wu8n9JROlo0edtEzp X-Received: by 10.28.54.3 with SMTP id d3mr4080513wma.34.1478107112681; Wed, 02 Nov 2016 10:18:32 -0700 (PDT) Received: from [10.137.2.17] (ip-89-177-44-58.net.upcbroadband.cz. [89.177.44.58]) by smtp.gmail.com with ESMTPSA id 1sm4366600wmk.22.2016.11.02.10.18.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 10:18:32 -0700 (PDT) Subject: Re: Speed up Clog Access by increasing CLOG buffers To: Amit Kapila References: <4a52a34f-57fa-7bcf-d34c-c15db40f0361@2ndquadrant.com> <956b695d-f6c5-d652-bf0c-cea95981547c@BlueTreble.com> <5275bf49-545e-e189-48c5-17b5defc45a2@2ndquadrant.com> Cc: Robert Haas , Jim Nasby , Dilip Kumar , Andres Freund , pgsql-hackers From: Tomas Vondra Message-ID: <71db49d4-2d90-bcb9-5778-ab5ce35d8c12@2ndquadrant.com> Date: Wed, 2 Nov 2016 18:18:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Thunderbird/46.0a2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 11/02/2016 05:52 PM, Amit Kapila wrote: > On Wed, Nov 2, 2016 at 9:01 AM, Tomas Vondra > wrote: >> On 11/01/2016 08:13 PM, Robert Haas wrote: >>> >>> On Mon, Oct 31, 2016 at 5:48 PM, Tomas Vondra >>> wrote: >>>> >> >> The one remaining thing is the strange zig-zag behavior, but that might >> easily be a due to scheduling in kernel, or something else. I don't consider >> it a blocker for any of the patches, though. >> > > The only reason I could think of for that zig-zag behaviour is > frequent multiple clog page accesses and it could be due to below > reasons: > > a. transaction and its subtransactions (IIRC, Dilip's case has one > main transaction and two subtransactions) can't fit into same page, in > which case the group_update optimization won't apply and I don't think > we can do anything for it. > b. In the same group, multiple clog pages are being accessed. It is > not a likely scenario, but it can happen and we might be able to > improve a bit if that is happening. > c. The transactions at same time tries to update different clog page. > I think as mentioned upthread we can handle it by using slots an > allowing multiple groups to work together instead of a single group. > > To check if there is any impact due to (a) or (b), I have added few > logs in code (patch - group_update_clog_v9_log). The log message > could be "all xacts are not on same page" or "Group contains > different pages". > > Patch group_update_clog_v9_slots tries to address (c). So if there > is any problem due to (c), this patch should improve the situation. > > Can you please try to run the test where you saw zig-zag behaviour > with both the patches separately? I think if there is anything due > to postgres, then you can see either one of the new log message or > performance will be improved, OTOH if we see same behaviour, then I > think we can probably assume it due to scheduler activity and move > on. Also one point to note here is that even when the performance is > down in that curve, it is equal to or better than HEAD. > Will do. Based on the results with more client counts (increment by 6 clients instead of 36), I think this really looks like something unrelated to any of the patches - kernel, CPU, or something already present in current master. The attached results show that: (a) master shows the same zig-zag behavior - No idea why this wasn't observed on the previous runs. (b) group_update actually seems to improve the situation, because the performance keeps stable up to 72 clients, while on master the fluctuation starts way earlier. I'll redo the tests with a newer kernel - this was on 3.10.x which is what Red Hat 7.2 uses, I'll try on 4.8.6. Then I'll try with the patches you submitted, if the 4.8.6 kernel does not help. Overall, I'm convinced this issue is unrelated to the patches. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers