Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGtBG-0003uf-6J for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jun 2016 19:23:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bGtBF-0002Nc-Dc for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jun 2016 19:23:49 +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 1bGtBD-0002Mg-4q for pgsql-performance@postgresql.org; Sat, 25 Jun 2016 19:23:47 +0000 Received: from mail-vk0-x232.google.com ([2607:f8b0:400c:c05::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bGtBA-0005bt-RZ for pgsql-performance@postgresql.org; Sat, 25 Jun 2016 19:23:46 +0000 Received: by mail-vk0-x232.google.com with SMTP id u64so189356098vkf.3 for ; Sat, 25 Jun 2016 12:23:44 -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=uMFlBljz2aGzC42xP/w3y/KZ021crBcx9/d+NHSYVnE=; b=tVhjEUPPhMV/ucrCfOySxRpLJo20y5AUS4zmi00HsoGbvxZ8Csv5VAZ93lo8IVWvNQ FQVWnXZ4aPrfHzSqPogChBJsL+bk+B/yP2ETOBoNFk262N0ox9wi3M1ZgYatXIdaAprr SlkMP8dgLDmxvm1n0E2vKdquv8F9nzJWYOdhnnrNQJGT9POGlCBGkV+2QIexYNa77WrP auSj5dhS385/TTt7JSoJAggg55urvCvRtaCq/beeOYnBZpIUpeDO++OEx7/0yyf0DLG3 RxXOMOuKJfUOnhUmavvmYOGb2ahW7RJ1zdT/uVqyM/jAg5sI43Pi4uFBPi2S6WZAcsFV tYYg== 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=uMFlBljz2aGzC42xP/w3y/KZ021crBcx9/d+NHSYVnE=; b=eHmZVYIpvIrTFXAhoY5CYpArCquGR95IcpVsk2Cj7fOmREpOi0ErwfRT/TcyyNCRde U6+KX99GyUHV7FsFnO2U25QoLtOtWuiOSc7U5krNBIn4pWXc1yeyTzuR35e9sgVzHJ1O /Y6Cs3VpywtWpU/hUzs44KVdzNGEmCCynLl0gkVOsB+CIPGQIyk3kqxYN9cQaFpNq7/A 5raenBsdI7YzVFoq7aN06TOV5WPc/w3NRHKS8dHQjsAyOmj73mRO3gF+0HLwgf/D++wu vZ4FMjySDjmj9+H3ZmTeQNu/0VWT9R2RH/O5pdKNdW9iv3paTdKie3W6ZS7mrqnl0MfK kwSg== X-Gm-Message-State: ALyK8tIoiYEH/rgFY/kPDtJRCTEv3qiJdZ3o9jxAKum0NWgLcRD7t2gzBN8W3NCwe46cStnFPCmU59NTgMD2qw== X-Received: by 10.31.87.129 with SMTP id l123mr5614650vkb.22.1466882622671; Sat, 25 Jun 2016 12:23:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.131.204 with HTTP; Sat, 25 Jun 2016 12:23:42 -0700 (PDT) In-Reply-To: <576EAF26.8080508@gmail.com> References: <576EAF26.8080508@gmail.com> From: Jeff Janes Date: Sat, 25 Jun 2016 12:23:42 -0700 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: text/plain; charset=UTF-8 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 On Sat, Jun 25, 2016 at 9:19 AM, t.dalpozzo@gmail.com wrote: > 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 portable. > > Performance: > Win7: 8000 write/sec > Linux: 419 write/sec > > I don't figure out why such a difference. Also what should I expect? Which > one is reasonable? The Win7 numbers seem suspiciously high to me, even for SSD. Have you tried holding the power button until it hard-resets the computer in the middle of a run (preferably several runs going in parallel), and see if comes back up without corruption and contains consistent data? And then repeat that a several times? > I compared the two postgresql.conf, they're identical (except obvious > things), they're the default ones, I didn't touch them. We don't know which things are obvious to you. > > 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 Rather than rolling your own program, can you run pg_test_fsync on each? Cheers, Jeff -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance