Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XUYms-0000Sa-6A for pgsql-performance@arkaria.postgresql.org; Thu, 18 Sep 2014 10:18:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XUYmr-0007sZ-B6 for pgsql-performance@arkaria.postgresql.org; Thu, 18 Sep 2014 10:18:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XUYmp-0007sQ-29 for pgsql-performance@postgresql.org; Thu, 18 Sep 2014 10:18:03 +0000 Received: from mail.catalyst.net.nz ([2404:130:0:10::40:0]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XUYmd-00023f-Tu for pgsql-performance@postgresql.org; Thu, 18 Sep 2014 10:17:59 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 618E332600; Thu, 18 Sep 2014 22:17:47 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d3X4tMLlrxzp; Thu, 18 Sep 2014 22:17:46 +1200 (NZST) Received: from [192.168.1.64] (122-62-5-20.jetstream.xtra.co.nz [122.62.5.20]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 0DBFA32560; Thu, 18 Sep 2014 22:17:46 +1200 (NZST) Message-ID: <541AB149.70504@catalyst.net.nz> Date: Thu, 18 Sep 2014 22:17:45 +1200 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: "Mkrtchyan, Tigran" , pgsql-performance@postgresql.org Subject: Re: postgres 9.3 vs. 9.4 References: <88549888.42916.1411034301200.JavaMail.zimbra@desy.de> In-Reply-To: <88549888.42916.1411034301200.JavaMail.zimbra@desy.de> 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-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 18/09/14 21:58, Mkrtchyan, Tigran wrote: > > > Hi Folk, > > I am trying to investigate some performance issues which we have with postgres > (a different topic by itself) and tried postgres.9.4beta2, with a hope that it > perform better. > > Turned out that 9.4 is 2x slower than 9.3.5 on the same hardware. > > Some technical details: > > Host: rhel 6.5 2.6.32-431.23.3.el6.x86_64 > 256 GB RAM, 40 cores, Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz > 2x160GB PCIe SSD DELL_P320h-MTFDGAL175SAH ( on one 9.3, on an other one 9.4 ) > > postgres tweaks: > > > default_statistics_target = 100 > wal_writer_delay = 10s > vacuum_cost_delay = 50 > synchronous_commit = off > maintenance_work_mem = 2GB > checkpoint_completion_target = 0.9 > effective_cache_size = 94GB > work_mem = 402MB > wal_buffers = 16MB > checkpoint_segments = 64 > shared_buffers = 8GB > max_connections = 100 > random_page_cost = 1.5 > # other goodies > log_line_prefix = '%m <%d %u %r> %%' > log_temp_files = 0 > log_min_duration_statement = 5 > > in both cases databases are fresh - no data. > > Here is a results with pgbench. > > > 9.3.5: > > # /usr/pgsql-9.3/bin/pgbench -r -j 1 -c 1 -T 60 > starting vacuum...end. > transaction type: TPC-B (sort of) > scaling factor: 1 > query mode: simple > number of clients: 1 > number of threads: 1 > duration: 60 s > number of transactions actually processed: 96361 > tps = 1605.972262 (including connections establishing) > tps = 1606.064501 (excluding connections establishing) > statement latencies in milliseconds: > 0.001391 \set nbranches 1 * :scale > 0.000473 \set ntellers 10 * :scale > 0.000430 \set naccounts 100000 * :scale > 0.000533 \setrandom aid 1 :naccounts > 0.000393 \setrandom bid 1 :nbranches > 0.000468 \setrandom tid 1 :ntellers > 0.000447 \setrandom delta -5000 5000 > 0.025161 BEGIN; > 0.131317 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; > 0.100211 SELECT abalance FROM pgbench_accounts WHERE aid = :aid; > 0.117406 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; > 0.114332 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; > 0.086660 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); > 0.035940 END; > > > 9.4beta2: > > # /usr/pgsql-9.3/bin/pgbench -r -j 1 -c 1 -T 60 > starting vacuum...end. > transaction type: TPC-B (sort of) > scaling factor: 1 > query mode: simple > number of clients: 1 > number of threads: 1 > duration: 60 s > number of transactions actually processed: 34017 > tps = 566.948384 (including connections establishing) > tps = 567.008666 (excluding connections establishing) > statement latencies in milliseconds: > 0.001879 \set nbranches 1 * :scale > 0.000526 \set ntellers 10 * :scale > 0.000490 \set naccounts 100000 * :scale > 0.000595 \setrandom aid 1 :naccounts > 0.000421 \setrandom bid 1 :nbranches > 0.000480 \setrandom tid 1 :ntellers > 0.000484 \setrandom delta -5000 5000 > 0.055047 BEGIN; > 0.172179 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; > 0.135392 SELECT abalance FROM pgbench_accounts WHERE aid = :aid; > 0.157224 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; > 0.147969 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; > 0.123001 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); > 0.957854 END; > > any ideas? > Hi Tigran, Some ideas: 60s is too short for reliable results (default settings for checkpoints is 300s so 600s is the typical elapsed time to get reasonably repeatable numbers (to ensure you get about 1 checkpoint in your run). In addition I usually do psql <