Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkCqK-0006eM-MG for pgsql-performance@arkaria.postgresql.org; Thu, 08 Oct 2015 15:10:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZkCqJ-0006R4-TV for pgsql-performance@arkaria.postgresql.org; Thu, 08 Oct 2015 15:10:51 +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) (envelope-from ) id 1ZkCoe-0004WJ-Vf for pgsql-performance@postgresql.org; Thu, 08 Oct 2015 15:09:09 +0000 Received: from sub5.mail.dreamhost.com ([208.113.200.129] helo=homiemail-a68.g.dreamhost.com) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZkCoX-0008Lw-Pm for pgsql-performance@postgresql.org; Thu, 08 Oct 2015 15:09:08 +0000 Received: from homiemail-a68.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a68.g.dreamhost.com (Postfix) with ESMTP id 1D46540113767 for ; Thu, 8 Oct 2015 08:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=stonebanks.ca; h=from:to :references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=stonebanks.ca; bh=NYg x8Tm9g6LqSfAQBhAZucgdgAU=; b=BOlp/1WmyTJuicr0xG3TDkSy/BXq80trzCL Yydjd01byZgv8JI9hye+RPM5sMB8HNxNcIeAN/CqCkgqcPKp6gJJ/v37aEPmpF6V irscSYXyn+HLgIurMvpnF7UTWYTCA+9MG3/OkL4V4G2n0tVVT9uHSNfmcW92ox48 yWfSYBZI= Received: from CAPRICA (modemcable216.122-161-184.mc.videotron.ca [184.161.122.216]) (Authenticated sender: carlo@stonebanks.ca) by homiemail-a68.g.dreamhost.com (Postfix) with ESMTPA id B695C4011376B for ; Thu, 8 Oct 2015 08:08:57 -0700 (PDT) From: "Carlo" To: References: <002a01d0ffe4$2c630e60$85292b20$@stonebanks.ca> <003d01d0ffe4$9ae8f890$d0bae9b0$@stonebanks.ca> <00fe01d10159$8e731980$ab594c80$@stonebanks.ca> In-Reply-To: Subject: Re: One long transaction or multiple short transactions? Date: Thu, 8 Oct 2015 11:08:55 -0400 Message-ID: <012e01d101db$4081f7a0$c185e6e0$@stonebanks.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFD1GuMjlYKSpoTBolbgZAO1EVkoAHr5u6yAbJNYmcBi2BbYgEy+PeOn0kOEdA= Content-Language: en-ca X-Pg-Spam-Score: -2.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 >> Sounds like a locking problem This is what I am trying to get at. The reason that I am not addressing hardware or OS configuration concerns is that this is not my environment, but my client's. The client is running my import software and has a choice of how long the transactions can be. They are going for long transactions, and I am trying to determine whether there is a penalty for single long transactions over a configuration which would allow for more successive short transactions. (keep in mind all reads and writes are single-row). There are other people working on hardware and OS configuration, and that's why I can't want to get into a general optimization discussion because the client is concerned with just this question. -----Original Message----- From: Graeme B. Bell [mailto:graeme.bell@nibio.no] Sent: October 8, 2015 4:55 AM To: Carlo Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] One long transaction or multiple short transactions? Sounds like a locking problem, but assuming you aren't sherlock holmes and simply want to get the thing working as soon as possible: Stick a fast SSD in there (whether you stay on VM or physical). If you have enough I/O, you may be able to solve the problem with brute force. SSDs are a lot cheaper than your time. Suggest you forward this to your operators: a talk I have about optimising multi-threaded work in postgres: http://graemebell.net/foss4gcomo.pdf (Slides: "Input/Output" in the middle of the talk and also the slides at the end labelled "For Techies") Graeme Bell p.s. You mentioned a VM. Consider making the machine physical and not VM. You'll get a performance boost and remove the risk of DB corruption from untrustworthy VM fsyncs. One day there will be a power cut or O/S crash during these your writes and with a VM you've a reasonable chance of nuking your DB because VM virtualised storage often doesn't honour fsync (for performance reasons), but it's fundamental to correct operation of PG. > On 08 Oct 2015, at 01:40, Carlo wrote: > > > I am told 32 cores on a LINUX VM. The operators have tried limiting the number of threads. They feel that the number of connections is optimal. However, under the same conditions they noticed a sizable boost in performance if the same import was split into two successive imports which had shorter transactions. > -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance