Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bnRrk-0006mz-MF for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Sep 2016 14:54:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bnRrk-0005ou-4K for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Sep 2016 14:54:16 +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 1bnRqM-0004Ft-6q for pgsql-hackers@postgresql.org; Fri, 23 Sep 2016 14:52:50 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bnRqI-0000j5-Kz for pgsql-hackers@postgresql.org; Fri, 23 Sep 2016 14:52:49 +0000 Received: by mail-wm0-x231.google.com with SMTP id l132so36316887wmf.0 for ; Fri, 23 Sep 2016 07:52:46 -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=IfBNhX6SErkRUSmI/a993bhg68Cfw+c74nJOBgf4hWc=; b=geEuro70eJjLycL3zP3JthG7530JrIhWgnirwZpQ2YEyp4DK6LGOx6RhZabafZwvrE mis45T9E5KoN7ilttill2414mRD1xGsOFgv6Za9cKPmoPS7+o5o3CwZb+Sn52erFf8rT aETy0JcSroJtDJU0Qu5/kb9yR1sp2pn5mPHAfl3CavltGbVIh8k3BriZYM3xw7oapCvG 3xtbDH0Ri2ouN/tvD0MYB+Hz68G7aq2GsswfBYUZ4L5j3NafW0VVqiLN12R2g7ZmUP1R AfNHsPNzmSjEfLN1g+EnLMBd517oEh6gy9/LMAv0auaQRR/07SJMPwkvaC3lKeqQxRqc tyLg== 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=IfBNhX6SErkRUSmI/a993bhg68Cfw+c74nJOBgf4hWc=; b=EhaMAtscHuoQJJRNaU5Yd4B7Jsd9C6hN17rppfjB33NjlIjVmo8Fp4cnImrC/Q/HGs PrEgk9X318lPVYaAIs4B+aWmj44+Xjx2Fe4eqE9A+gcsqvp0suqeZbmSpxoqlCt0FYkR yoQ7/9fY/YMXhneLROrrUSap1hkQfdOMVs0S9RgRA1LQeRMOWFBvf+HGD3LtXwJZ5llF 6/dMoI6etzJ6V7Vg2oSFM7f1JTeuZgDSzaZ/ZJvFIk1gTfUcvV7SuBzcmQm6Aqb/P5Xu 1ic/jn/Q2g1+NE7UzyZf5Nbl2K1e3vL7nah/2xInNdHUYjQXMGG6SQMKLTOtn8SdBe93 y4BA== X-Gm-Message-State: AE9vXwPBEvk0qn8bS9PY0hIegwtkbAQTf2ZMT3wqhqc6iRKzfio8+Dz1mXMjNpsZFfFhUYJTTjNdeL6q9qSUNkDxw/3dHX/j4GFugAOcjIwenx0Z3bzwtCLf3+DeYqtBWK7oVivn6DC4rBAtHEHz8oN7yBVcrrzfuAmFgLy0imeEQXlI94PupgWgOInWLTUWrQWS29ifvHYF X-Received: by 10.194.103.3 with SMTP id fs3mr7129413wjb.115.1474642365622; Fri, 23 Sep 2016 07:52:45 -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 uw3sm7608722wjb.21.2016.09.23.07.52.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Sep 2016 07:52:44 -0700 (PDT) Subject: Re: Speed up Clog Access by increasing CLOG buffers To: Amit Kapila References: <0733fb9c-c3dc-fe30-1ad1-8c3ddf05c92d@2ndquadrant.com> <3dfb27e5-d3d3-20bb-2b35-3a0e2747625f@2ndquadrant.com> <9e877db7-4dc2-88c1-67ae-034ad1a5cafe@2ndquadrant.com> <26b69fb2-fa4d-530c-7783-1cb9d952c4e5@2ndquadrant.com> <781ac43c-da69-f5c7-a828-7b995691d4cc@2ndquadrant.com> Cc: Robert Haas , Dilip Kumar , Andres Freund , pgsql-hackers From: Tomas Vondra Message-ID: <5da94f12-8141-2f2f-016a-09a8e37bdd30@2ndquadrant.com> Date: Fri, 23 Sep 2016 16:52:40 +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; 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 09/23/2016 03:07 PM, Amit Kapila wrote: > On Fri, Sep 23, 2016 at 6:16 PM, Tomas Vondra > wrote: >> On 09/23/2016 01:44 AM, Tomas Vondra wrote: >>> >>> ... >>> The 4.5 kernel clearly changed the results significantly: >>> >> ... >>> >>> >>> (c) Although it's not visible in the results, 4.5.5 almost perfectly >>> eliminated the fluctuations in the results. For example when 3.2.80 >>> produced this results (10 runs with the same parameters): >>> >>> 12118 11610 27939 11771 18065 >>> 12152 14375 10983 13614 11077 >>> >>> we get this on 4.5.5 >>> >>> 37354 37650 37371 37190 37233 >>> 38498 37166 36862 37928 38509 >>> >>> Notice how much more even the 4.5.5 results are, compared to 3.2.80. >>> >> >> The more I think about these random spikes in pgbench performance on 3.2.80, >> the more I find them intriguing. Let me show you another example (from >> Dilip's workload and group-update patch on 64 clients). >> >> This is on 3.2.80: >> >> 44175 34619 51944 38384 49066 >> 37004 47242 36296 46353 36180 >> >> and on 4.5.5 it looks like this: >> >> 34400 35559 35436 34890 34626 >> 35233 35756 34876 35347 35486 >> >> So the 4.5.5 results are much more even, but overall clearly below 3.2.80. >> How does 3.2.80 manage to do ~50k tps in some of the runs? Clearly we >> randomly do something right, but what is it and why doesn't it happen on the >> new kernel? And how could we do it every time? >> > > As far as I can see you are using default values of min_wal_size, > max_wal_size, checkpoint related params, have you changed default > shared_buffer settings, because that can have a bigger impact. Huh? Where do you see me using default values? There are settings.log with a dump of pg_settings data, and the modified values are checkpoint_completion_target = 0.9 checkpoint_timeout = 3600 effective_io_concurrency = 32 log_autovacuum_min_duration = 100 log_checkpoints = on log_line_prefix = %m log_timezone = UTC maintenance_work_mem = 524288 max_connections = 300 max_wal_size = 8192 min_wal_size = 1024 shared_buffers = 2097152 synchronous_commit = on work_mem = 524288 (ignoring some irrelevant stuff like locales, timezone etc.). > Using default values of mentioned parameters can lead to checkpoints in > between your runs. So I'm using 16GB shared buffers (so with scale 300 everything fits into shared buffers), min_wal_size=16GB, max_wal_size=128GB, checkpoint timeout 1h etc. So no, there are no checkpoints during the 5-minute runs, only those triggered explicitly before each run. > Also, I think instead of 5 mins, read-write runs should be run for 15 > mins to get consistent data. Where does the inconsistency come from? Lack of warmup? Considering how uniform the results from the 10 runs are (at least on 4.5.5), I claim this is not an issue. > For Dilip's workload where he is using only Select ... For Update, i > think it is okay, but otherwise you need to drop and re-create the > database between each run, otherwise data bloat could impact the > readings. And why should it affect 3.2.80 and 4.5.5 differently? > > I think in general, the impact should be same for both the kernels > because you are using same parameters, but I think if use > appropriate parameters, then you can get consistent results for > 3.2.80. I have also seen variation in read-write tests, but the > variation you are showing is really a matter of concern, because it > will be difficult to rely on final data. > Both kernels use exactly the same parameters (fairly tuned, IMHO). -- 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