Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BB071475B57 for ; Wed, 14 Aug 2002 11:29:32 -0400 (EDT) Received: from mta5.snet.net (mta5.snet.net [204.60.203.77]) by postgresql.org (Postfix) with ESMTP id 2B5304759C7 for ; Wed, 14 Aug 2002 11:29:32 -0400 (EDT) Received: from pop.snet.net ([204.60.203.73]) 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 g7EFQat0007895; Wed, 14 Aug 2002 11:26:36 -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 g7EFTPT0024571; Wed, 14 Aug 2002 11:29:29 -0400 (EDT) Subject: Re: concurrent connections is worse than serialization? From: Wei Weng To: Richard Huxton Cc: pgsql-sql@postgresql.org In-Reply-To: <200208141549.57646.dev@archonet.com> References: <1029271170.16828.7.camel@Monet> <200208141018.38875.dev@archonet.com> <1029334827.21470.2.camel@Monet> <200208141549.57646.dev@archonet.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 14 Aug 2002 11:29:26 -0400 Message-Id: <1029338971.21470.9.camel@Monet> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/235 X-Sequence-Number: 9081 On Wed, 2002-08-14 at 10:49, Richard Huxton wrote: > On Wednesday 14 Aug 2002 3:20 pm, Wei Weng wrote: > > On Wed, 2002-08-14 at 05:18, Richard Huxton wrote: > > > On Tuesday 13 Aug 2002 9:39 pm, Wei Weng wrote: > > [30 connections is much slower than 1 connection 30 times] Yeah, but the problem is, say I have 20 users using select on the database at the same time, and each select takes 10 seconds to finish. I really can't queue them up (or the last user will reall have to wait for a long time), can I? > > > > 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%. > > Something must be the limiting factor. One of > - CPU > - Memory > - Disk I/O > - Database (configuration, or design) > - Application > > If it's not CPU, is the system going into swap or are you seeing a lot of disk > activity? I did hear a lot of disk noise when I ran the test. How do I tell if the "system is going into swap"? Is there any system settings I can/should change to make this a little faster? > > > > I assume you've ruled the application end of things out. > > > > What does this mean? > > I mean if you don't actually run the queries, then 30 separate processes is > fine? > > If you can provide us with an EXPLAIN of the query and the relevant schema > definitions, we can rule out database design. > This is actually really simple. A table like -------------------- | foo | -------------------- |ID VARCHAR(40) | --> primary key |Name VARCHAR(100)| -------------------- And I did an INSERT INTO foo ('some-unique-guid-here', 'Test Name'); So I don't think it is any matter of the database. Thanks -- Wei Weng Network Software Engineer KenCast Inc.