Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhbkA-0007Za-Ke for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Sep 2016 12:14:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bhbkA-0005WN-64 for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Sep 2016 12:14:18 +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 1bhbk9-0005WH-MF for pgsql-hackers@postgresql.org; Wed, 07 Sep 2016 12:14:17 +0000 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bhbk6-0007zf-63 for pgsql-hackers@postgresql.org; Wed, 07 Sep 2016 12:14:17 +0000 Received: by mail-it0-x231.google.com with SMTP id i184so29847448itf.1 for ; Wed, 07 Sep 2016 05:14:13 -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=WzoOsy6SEj5gMkAJCI+eWmsB2h1UOhTtLh9vmzc7Qvs=; b=rP9rzcLBH+W3uJ1a9mzpbvwlgONAOijG1EVzxMUUAqDw200Gv6B1bSE6lMxzVoLrci hRJk3d3kqPvdR8k+8mMair1iZ4jQdkymfT7LKnrV9LqcQ0e3vUvg7cjxL9uhF7V0VpDy TnUvrHPUfzlpXajH/+7F5Mt6eOxzDKPFv94oUDhc/HT2b9y321yGcqtYd2FgfeR18Ql2 N0uKYnBv3pVr6z7MXgf0Im47sCgZ7BHyB9g6SU1Kf+vYduhXji2wzHDeeBCAIeUC2YKX fxqt0J3MrtlmVWjMsiuKzZ/hl1+7YdkAReP1tO6GwcICdvWTZ3Z2i2F7/gHcKU/EPhKu vTFQ== 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=WzoOsy6SEj5gMkAJCI+eWmsB2h1UOhTtLh9vmzc7Qvs=; b=f7Y0Y3JnvqOWUk8LdrWC2Fcg1IdsJHmoaHvaX8crm1A5N2zCQpY9jgEuygP4GPVd7q jy4Ir5IL/5kKEGXa0LpxqZ2oZD/nioixHvPBkTSbRhhzToASaA1CWWm9Z7t80R2IJCAJ rxDkK7JYcP0EvTeXT+iMxt8bZYJHfNpRIXCs/Qj+a0Xnc2mgaGtyDE5r5nxGaV4auUgT DnA83FOdz6zTfaNTn8dp3t2riC4WsUFcddOYvzI6mTvrW73fYfNMInYKpOafFQm0sRdp +Y1X+dLu0M3xPE1fzU6CKAGjqhqSNaCRx0drrLrG9dukRlRIDMcAWu0ZZ5qa2oEd01VO Aotw== X-Gm-Message-State: AE9vXwPbUZNJdiwKpGzAkoJI9hfu4pf03epzH7lyFQ0i0ctp6spJrlpwIdylaMcgToJqZ3+m2ZqtRj33j1uBhLoAlb4i+7f6jlqhFOf/VtPqezndxO5EAFRD4OW/8duekEnJThRpBri7bmlW+Q1B8VryUHTaNBPPmZYMmgcMKU7xdaQLaoCqA0/T9xy+ysB25/C5fkjpIkGC X-Received: by 10.36.149.193 with SMTP id m184mr6031353itd.94.1473250451951; Wed, 07 Sep 2016 05:14:11 -0700 (PDT) Received: from [10.137.2.20] ([161.225.196.30]) by smtp.gmail.com with ESMTPSA id 8sm2717821itm.3.2016.09.07.05.14.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Sep 2016 05:14:11 -0700 (PDT) Subject: Re: Speed up Clog Access by increasing CLOG buffers To: Amit Kapila References: <20150903114137.GE27649@awork2.anarazel.de> <20160330230914.GH13305@awork2.anarazel.de> <20160408153054.hgubabeycowlu3tc@alap3.anarazel.de> <8bab43dd-bc76-0c41-950e-8101269dbf4b@2ndquadrant.com> <195ecd3b-0085-fe6a-762b-cd5dc3321e8c@2ndquadrant.com> <800c71e5-13a6-887b-250d-0ab8706533e3@2ndquadrant.com> Cc: Andres Freund , pgsql-hackers From: Tomas Vondra Message-ID: <5b4e50ff-02a7-2838-10e6-da758637338f@2ndquadrant.com> Date: Wed, 7 Sep 2016 14:14:03 +0200 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 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 09/07/2016 01:13 PM, Amit Kapila wrote: > On Wed, Sep 7, 2016 at 1:08 AM, Tomas Vondra > wrote: >> On 09/06/2016 04:49 AM, Amit Kapila wrote: >>> On Mon, Sep 5, 2016 at 11:34 PM, Tomas Vondra >>> wrote: >>>> >>>> >>>> On 09/05/2016 06:03 AM, Amit Kapila wrote: >>>>> So, in short we have to compare three >>>>> approaches here. >>>>> >>>>> 1) Group mode to reduce CLOGControlLock contention >>>>> 2) Use granular locking model >>>>> 3) Use atomic operations >>>>> >>>>> For approach-1, you can use patch [1]. For approach-2, you can use >>>>> 0001-Improve-64bit-atomics-support patch[2] and the patch attached >>>>> with this mail. For approach-3, you can use >>>>> 0001-Improve-64bit-atomics-support patch[2] and the patch attached >>>>> with this mail by commenting USE_CONTENT_LOCK. If the third doesn't >>>>> work for you then for now we can compare approach-1 and approach-2. >>>>> >>>> >>>> OK, I can compile all three cases - but onl with gcc 4.7 or newer. Sadly >>>> the 4-socket 64-core machine runs Debian Jessie with just gcc 4.6 and my >>>> attempts to update to a newer version were unsuccessful so far. >>>> >>> >>> So which all patches your are able to compile on 4-socket m/c? I >>> think it is better to measure the performance on bigger machine. >> >> Oh, sorry - I forgot to mention that only the last test (with >> USE_CONTENT_LOCK commented out) fails to compile, because the functions >> for atomics were added in gcc-4.7. >> > > No issues, in that case we can leave the last test for now and do it later. > FWIW I've managed to compile a new GCC on the system (all I had to do was to actually read the damn manual), so I'm ready to do the test once I get a bit of time. 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