Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGw5d-00048G-K1 for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jun 2016 22:30:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bGw5d-0003G8-5M for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jun 2016 22:30: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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bGw3v-0001Na-CL for pgsql-performance@postgresql.org; Sat, 25 Jun 2016 22:28:27 +0000 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bGw3n-0000xd-0g for pgsql-performance@postgresql.org; Sat, 25 Jun 2016 22:28:26 +0000 Received: by mail-oi0-x233.google.com with SMTP id u201so158543492oie.0 for ; Sat, 25 Jun 2016 15:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BQczJpV3Qq8F4srSGHuZH2rTjJLeQf/UGtEmjMGnVTk=; b=lbwFoC45UEP58qX0nHHyzmu3Md4zpuGkVD3tEhlfoR01HnMgpoDTYvnHC5u/y0cUhW Y2BSC/UtNsAizp8f4d30GvdV+FD37TUBvNdA6wUtX2VqfZKulO3A94FegythGr7i31mm qDN33Sa1cczE9qH/rjvS4iBb7k9i/W4UxtmENaG/2gatGFm7xd/Nmb+1zo+ZxvZZ5ySM lSomU3ec/6jLI1omQHbJdKIb0LEeOXZKB98elqJksov3ZH4cmnQrAzjcNrDeN/vda39i Eop3wfW2W2y4edzA3Vu9goB3b9kcPtHsZCzUDInBu+TaeYE8lJ8zuSwa3HXz9ZKatJHt Nssg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BQczJpV3Qq8F4srSGHuZH2rTjJLeQf/UGtEmjMGnVTk=; b=jGJ0dHr78RO0BR/7CVBjsjZ1cvDYbHP0MUOkS7PBoib9b90OfSoI7BXBS+mbZRja/b UkkSCuY6LNa4VEUEwyMIEwjwjOJxrJHAySTM72LwGwgyd27rWfJPGiFT/KD0aHPe+5Z6 27qCGOuTfS3FNFZQewRHz9952OZQfunuMfmhl9FpJM5h3Ot+GuyEXcH3AbdBcngT628i fLA5GtSL08FGaCk/YbD0Vzyc7xFcJcxiYX4spsAggkw6GjVppQovr+NBNt58lGSgVxIH Tk5nJVs8f5LXvezKGrtz3mbxyxYwWx3VGcTr24HhlxQHb3RqhzUinM9DribG6fBz4Bvm /P2w== X-Gm-Message-State: ALyK8tIok04pAi2gAq86EpkRH0Z/apfGkSRsYt3+sklgioTbh8cuNbkPhhnzIZadoHqGdSiuueSikorO91acDw== X-Received: by 10.202.173.74 with SMTP id w71mr6969936oie.117.1466893696614; Sat, 25 Jun 2016 15:28:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.162.36 with HTTP; Sat, 25 Jun 2016 15:27:57 -0700 (PDT) In-Reply-To: <576EAF26.8080508@gmail.com> References: <576EAF26.8080508@gmail.com> From: Imre Samu Date: Sun, 26 Jun 2016 00:27:57 +0200 Message-ID: Subject: Re: can't explain commit performance win7 vs linux : 8000/s vs 419/s To: "t.dalpozzo@gmail.com" Cc: "pgsql-performance@postgresql.org" Content-Type: multipart/alternative; boundary=001a113ce55ab5cc30053621cd07 X-Pg-Spam-Score: -1.7 (-) 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 --001a113ce55ab5cc30053621cd07 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable my guess: - maybe the NTFS compression is enabled? [ "Compress this drive to save disk space=E2=80=9D ? ] [ your test data is ideal for compression: VALUE= S ('AAAAAA...... 250 times') ] - or Windows Samsung Magician extreme settings? or RAPID mode cache enabled? "RAPID mode is a RAM caching feature. Samsung=E2=80=99s RAPID white paper s= tates that RAPID works by analyzing =E2=80=9Csystem traffic and leverages spare s= ystem resources (DRAM and CPU) to deliver read acceleration through intelligent caching of hot data and write optimization through tight coordination with the SSD.=E2=80=9D http://www.thessdreview.com/software-2/samsung-magician-4-5-rapid-mode-2-1-= testing/ on Ubuntu16.04 (+ Samsung SSD 840 PRO ) I use "Samsung SSD Magician DC " trim optimization [ "sudo ./magician -d 0 -T " ] http://jcutrer.com/howto/linux/samsung-magician-command-line-linux $ sudo ./magician =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Samsung(R) SSD Magician DC Version 1.0 Copyright (c) 2014 Samsung Corporation =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Usage: ./magician [operation] .. Allowed Operations: -L[ --list] Shows a disk(s) attached to the system. -F[ --firmware-update] Updates firmware to specified disk. -E[ --erase] Securely Erases all data from specified disk. -O[ --over-provision] Performs one of the Over-Provisioning related operations on specified disk. *-T[ --trim] Optimizes specified disk. * -S[ --smart] Shows S.M.A.R.T values of specified disk. -M[ --setmax] Performs SetMax related operations on specified disk. -W[ --writecache] Enables/Disables Write Cache on specified disk. -X[ --sctcachestate] Gets the SCT write cache state for specified disk. -C[ --command-history] Shows history of the previously executed commands. -I[ --info] Displays the disk details to the user. -license Shows the End User License Agreement. -H[ --help] Shows detailed Help. regards, Imre 2016-06-25 18:19 GMT+02:00 t.dalpozzo@gmail.com : > Hi, > I've postgres 9.5.3 installed on win7 64 bit, and ubuntu 16.04tls 64 bit, > same SSD (evo 850 pro) , two different partitions. Laptop is 3.8Ghz. > I've in each partition a simple database with one table called data256 > with one column of 256 char. > I wrote a program using libpq which: > 1 connects to 127.0.0.1 to the server > 2 drops and recreates the table; > 3 executes 2000 times the exec() function with the command "INSERT INTO > data256 VALUES ('AAAAAA...... 250 times')" > I want to commit after every insert of course. > The program is the same both in win and linux; in ansi c, so it's portabl= e. > > Performance: > Win7: 8000 write/sec > Linux: 419 write/sec > > I don't figure out why such a difference. Also what should I expect? Whic= h > one is reasonable? > > I compared the two postgresql.conf, they're identical (except obvious > things), they're the default ones, I didn't touch them. I just tried to > disable ssl in one because it was set but nothing changes. > I didn't go into deeper analysis because the source C file used for test > is the same and the two postgresql.conf are identical. > > Then, in order to test write / flush without postgres, I made another C > program, to open a file in writing, and for 1000 times : write 256 bytes > and flush them (using fsync in linux and FlushFileBuffers in win). > Win7: 200 write/sec > Linux: 100 write/sec > > > > > Thanks > Pupillo > > > > > > > > > > > > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org= ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > --001a113ce55ab5cc30053621cd07 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
my guess:
- maybe the NTFS compression is enabled? =C2= =A0[ =C2=A0"Compress this drive to save disk space=E2=80=9D ? ] =C2=A0= [=C2=A0=C2=A0your test data is ideal for c= ompression: =C2=A0VALUES ('AAAA= AA...... 250 times') ]
- or Windows Samsung Magician extreme settings? =C2=A0or RAPID mode = cache enabled?=C2=A0
"RAPID mode is a RAM caching feature. S= amsung=E2=80=99s RAPID white paper states that RAPID works by analyzing =E2= =80=9Csystem traffic and leverages spare system resources (DRAM and CPU) to= deliver read acceleration through intelligent caching of hot data and writ= e optimization through tight coordination with the SSD.=E2=80=9D
<= div>

on Ubuntu16.04 =C2=A0(+ Samsung SSD = 840 PRO ) =C2=A0 =C2=A0I use "Samsung SSD Magician DC " =C2=A0tri= m optimization =C2=A0 [ "sudo ./magician -d 0 -T " ]
http://jcutrer.com/howto/linux/samsung-magician-command-line-linux
$ sudo ./magician
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Samsung(R) SSD Magician DC Version 1.0
Copyright (c) 2014 Samsung Corporation
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Usage: =C2=A0./magician =C2=A0[operation] ..
<= font face=3D"monospace, monospace">
Allowed Operations:
-L[ --list] =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0Shows a disk(s) attached to the system. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0=C2=A0
-F[ --firmwa= re-update] =C2=A0 Updates firmware to specified disk. =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
-E[ --erase] =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Securely= Erases all data from specified disk. =C2=A0 =C2=A0=C2=A0
= -O[ --over-provision] =C2=A0 =C2=A0Perf= orms one of the Over-Provisioning related =C2=A0 =C2=A0=C2=A0
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0operations on specif= ied disk. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=C2=A0
-T[ --trim] =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0Optimizes specified disk. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
-S[ --smart] =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 Shows S.M.A.R.T values of specified disk. =C2=A0 =C2=A0 =C2= =A0 =C2=A0=C2=A0
-M[ -= -setmax] =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Performs SetMax related o= perations on specified disk.
-W[ --writecache] =C2=A0 =C2=A0 =C2=A0 =C2=A0Enables/Disables Write = Cache on specified disk. =C2=A0=C2=A0
-X[ --sctcachestate] =C2=A0 =C2=A0 Gets the SCT write cache= state for specified disk.
-C[ --command-history] =C2=A0 Shows history of the previously executed= commands.
-I[ --info]= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Displays the disk details = to the user. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
-license =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 Shows the End User License Agreement. =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
-H[ --help] =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0Shows detailed Help. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

regards,
=C2=A0Imre
=

2= 016-06-25 18:19 GMT+02:00 t.dalpozz= o@gmail.com <t.dalpozzo@gmail.com>:
Hi,
I've postgres 9.5.3 installed on win7 64 bit, and ubuntu 16.04tls 64 bi= t,=C2=A0 same SSD (evo 850 pro) , two different partitions. Laptop is 3.8Gh= z.
I've in each partition a simple database with one table called data256 = with one column of 256 char.
I wrote a program using libpq which:
1 connects to 127.0.0.1 to the server
2 drops and recreates the table;
3 executes 2000 times the exec() function with the command=C2=A0 "INSE= RT INTO data256 VALUES ('AAAAAA...... 250 times')"
I want to commit after every insert of course.
The program is the same both in win and linux; in ansi c, so it's porta= ble.

Performance:
Win7: 8000 write/sec
Linux: 419 write/sec

I don't figure out why such a difference. Also what should I expect? Wh= ich one is reasonable?

I compared the two postgresql.conf, they're identical (except obvious t= hings), they're the default ones, I didn't touch them. I just tried= to disable ssl in one because it was set but nothing changes.
I didn't go into deeper analysis because the source C file used for tes= t is the same and the two postgresql.conf are identical.

Then, in order to test write / flush without postgres, I made another C pro= gram, to open a file in writing, and for 1000 times : write 256 bytes and f= lush them (using fsync in linux and FlushFileBuffers in win).
Win7: 200 write/sec
Linux: 100 write/sec




Thanks
Pupillo












--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-perform= ance

--001a113ce55ab5cc30053621cd07--