Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ5ms-0003Zg-Fk for pgsql-performance@arkaria.postgresql.org; Tue, 18 Dec 2018 03:11:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZ5mr-0006SD-3M for pgsql-performance@arkaria.postgresql.org; Tue, 18 Dec 2018 03:11:13 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ5mq-0006S5-SO for pgsql-performance@lists.postgresql.org; Tue, 18 Dec 2018 03:11:12 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ5mh-0007g2-6h for pgsql-performance@lists.postgresql.org; Tue, 18 Dec 2018 03:11:11 +0000 Received: from [IPv6:2406:e001:83f:7801:8c5b:96f3:2014:eec1] (unknown [IPv6:2406:e001:83f:7801:8c5b:96f3:2014:eec1]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 5742C80F85 for ; Tue, 18 Dec 2018 16:10:51 +1300 (NZDT) Subject: Re: pgbench results arent accurate To: pgsql-performance@lists.postgresql.org References: From: Mark Kirkwood Message-ID: <9cccf498-527f-cd7b-8601-853d10b7990c@catalyst.net.nz> Date: Tue, 18 Dec 2018 16:10:50 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: ORIGINATING; auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, I can see two issues making you get variable results: 1/ Number of clients > scale factor Using -c16 and -s 6 means you are largely benchmarking lock contention for a row in the branches table (it has 6 rows in your case). So randomness in *which* rows each client tries to lock will make for unwanted variation. 2/ Short run times That 1st run is 5s duration. This will be massively influenced by the above point about randomness for locking a branches row. I'd recommend: - always run at least -T600 - use -s of at least 1.5x your largest -c setting (I usually use -s 100 for testing 1-32 clients). regards Mark On 17/12/18 12:58 AM, Mariel Cherkassky wrote: > As Greg suggested, update you all that each vm has its own dedicated > esx. Every esx has it`s own local disks. > I run it one time on two different servers that has the same hardware > and same postgresql db (version and conf). The results : > pgbench -i -s 6  pgbench -p 5432 -U postgres >  pgbench -c 16 -j 4 -T 5 -U postgres pgbench > MACHINE 1 > starting vacuum...end. > transaction type: > scaling factor: 6 > query mode: simple > number of clients: 16 > number of threads: 4 > duration: 5 s > number of transactions actually processed: 669 > latency average = 122.633 ms > tps = 130.470828 (including connections establishing) > tps = 130.620286 (excluding connections establishing) > > MACHINE 2 > > pgbench -c 16 -j 4 -T 600 -U postgres -p 5433 pgbench > starting vacuum...end. > transaction type: > scaling factor: 6 > query mode: simple > number of clients: 16 > number of threads: 4 > duration: 600 s > number of transactions actually processed: 2393723 > latency average = 4.011 ms > tps = 3989.437514 (including connections establishing) > tps = 3989.473036 (excluding connections establishing) > > any idea what can cause such a difference ? Both of the machines have > 20core and 65GB of ram. > > ‫בתאריך יום ה׳, 13 בדצמ׳ 2018 ב-15:54 מאת ‪Mariel Cherkassky‬‏ > <‪mariel.cherkassky@gmail.com ‬‏>:‬ > > Ok, I'll do that.  Thanks . > > ‫בתאריך יום ה׳, 13 בדצמ׳ 2018 ב-15:54 מאת ‪Greg Clough‬‏ > <‪Greg.Clough@ihsmarkit.com ‬‏>:‬ > > Hmmm... sounds like you’ve got most of it covered.  It may be > a good idea to send that last message back to the list, as > maybe others will have better ideas. > > Greg. > > *From:* Mariel Cherkassky > > *Sent:* Thursday, December 13, 2018 1:45 PM > *To:* Greg Clough > > *Subject:* Re: pgbench results arent accurate > > Both of the machines are the only vms in a dedicated esx for > each one. Each esx has local disks. > > On Thu, Dec 13, 2018, 3:05 PM Greg Clough > > wrote: > > > I installed a new postgres 9.6 on both of my machines. > > Where is your storage?  Is it local, or on a SAN?  A SAN > will definitely have a cache, so possibly there is another > layer of cache that you’re not accounting for. > > Greg Clough. > > ------------------------------------------------------------------------ > > > This e-mail, including accompanying communications and > attachments, is strictly confidential and only for the > intended recipient. Any retention, use or disclosure not > expressly authorised by IHSMarkit is prohibited. This > email is subject to all waivers and other terms at the > following link: > https://ihsmarkit.com/Legal/EmailDisclaimer.html > > Please visit www.ihsmarkit.com/about/contact-us.html > for > contact information on our offices worldwide. > > > ------------------------------------------------------------------------ > > This e-mail, including accompanying communications and > attachments, is strictly confidential and only for the > intended recipient. Any retention, use or disclosure not > expressly authorised by IHSMarkit is prohibited. This email is > subject to all waivers and other terms at the following link: > https://ihsmarkit.com/Legal/EmailDisclaimer.html > > Please visit www.ihsmarkit.com/about/contact-us.html > for contact > information on our offices worldwide. >