Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E72614754A8 for ; Wed, 14 Aug 2002 10:20:26 -0400 (EDT) Received: from mta5.snet.net (mta5.snet.net [204.60.203.77]) by postgresql.org (Postfix) with ESMTP id 7940E475BF2 for ; Wed, 14 Aug 2002 10:20:25 -0400 (EDT) Received: from pop.snet.net (pop.snet.net [204.60.203.72]) by mta5.snet.net (8.12.3/8.12.3/SNET-mx-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g7EEHVt0012475; Wed, 14 Aug 2002 10:17:31 -0400 (EDT) X-Originating-IP: [64.252.95.167] X-SBCIS-MTA: [pop.snet.net] Received: from [192.168.1.83] (167.95.252.64.snet.net [64.252.95.167]) by pop.snet.net (8.12.3/8.12.3/SNET-pop-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g7EEKOT0022372; Wed, 14 Aug 2002 10:20:24 -0400 (EDT) Subject: Re: concurrent connections is worse than serialization? From: Wei Weng To: Richard Huxton Cc: pgsql-sql@postgresql.org In-Reply-To: <200208141018.38875.dev@archonet.com> References: <1029271170.16828.7.camel@Monet> <200208141018.38875.dev@archonet.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 14 Aug 2002 10:20:26 -0400 Message-Id: <1029334827.21470.2.camel@Monet> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/229 X-Sequence-Number: 9075 On Wed, 2002-08-14 at 05:18, Richard Huxton wrote: > On Tuesday 13 Aug 2002 9:39 pm, Wei Weng wrote: > > I have a testing program that uses 30 concurrent connections > > (max_connections = 32 in my postgresql.conf) and each does 100 > > insertions to a simple table with index. > > > > It took me approximately 2 minutes to finish all of them. > > > > But under the same environment(after "delete From test_table, and vacuum > > analyze"), I then queue up all those 30 connections one after another > > one (serialize) and it took only 30 seconds to finish. > > > > Why is it that the performance of concurrent connections is worse than > > serializing them into one? > > What was the limiting factor during the test? Was the CPU maxed, memory, disk > I/O? No, none of the above was maxed. CPU usage that I paid attention to was at most a 48%. > > I take it the insert really *is* simple - no dependencies etc. > > > I was testing them using our own (proprietary) scripting engine and the > > extension library that supports postgresql serializes the queries by > > simply locking when a query manipulates a PGconn object and unlocking > > when it is done. (And similiarly, it creates a PGconn object on the > > stack for each concurrent queries.) > > I assume you've ruled the application end of things out. What does this mean? Thanks -- Wei Weng Network Software Engineer KenCast Inc.