Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zm0Ui-0001vY-Hf for pgsql-performance@arkaria.postgresql.org; Tue, 13 Oct 2015 14:24:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zm0Ui-0005QU-3B for pgsql-performance@arkaria.postgresql.org; Tue, 13 Oct 2015 14:24:00 +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 1Zm0Uh-0005QO-OD for pgsql-performance@postgresql.org; Tue, 13 Oct 2015 14:23:59 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Zm0Ua-0005j9-R5 for pgsql-performance@postgresql.org; Tue, 13 Oct 2015 14:23:59 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id E3256860001; Tue, 13 Oct 2015 16:23:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC6AC5.dip0.t-ipconnect.de [93.220.106.197]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 8AED8860003; Tue, 13 Oct 2015 16:23:36 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 22D06103001; Tue, 13 Oct 2015 16:23:36 +0200 (CEST) Date: Tue, 13 Oct 2015 16:23:36 +0200 From: Andres Freund To: Shaun Thomas Cc: Heikki Linnakangas , pgsql-performance@postgresql.org Subject: Re: Having some problems with concurrent COPY commands Message-ID: <20151013142336.GG10323@awork2.anarazel.de> References: <20151012182808.GB10323@awork2.anarazel.de> <561CCFB6.6040405@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.2 (----) 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 2015-10-13 07:14:01 -0700, Shaun Thomas wrote: > On Tue, Oct 13, 2015 at 2:32 AM, Heikki Linnakangas wrote: > > 80% of the CPU time is spent in the b-tree comparison function. > > In the logs, my duration per COPY command increases from about 1400ms > for one process to about 3800ms when I have four running concurrently. > That's really my only data point, unfortunately. Strace isn't super > helpful because it just says 70-ish% of the time is wait4, but that's > not significantly different than the results using one process. Please run a profile. Compile postgres with CFLAGS='-O2 -fno-omit-frame-pointer' as an argument to configure. That'll allow us to get a hierarchical profile. Then first do a plain cpu profile: perf record -g -a sleep 5 perf report > somefile Then let's look at lock contention: perf record -g -a -e syscalls:sys_enter_semop sleep 5 perf report > somefile and send the results. Thanks, Andres -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance