Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 09396650411 for ; Tue, 8 Jul 2008 00:57:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 13726-01-3 for ; Tue, 8 Jul 2008 00:56:52 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.179]) by postgresql.org (Postfix) with ESMTP id 3FBCE6504A5 for ; Tue, 8 Jul 2008 00:39:29 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d37so1312825pye.29 for ; Mon, 07 Jul 2008 20:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=q3tzALM9amwRBES8hOBqOq+hdjOMXhGOeOzibeca1Y0=; b=eSAZEokcUdbLUKQLC4Ack8++rNkGqHC6dhtqJGUzfT+GoT4iMVkFbYb55ztb+8dBVC 63XNsr/wRN0QaQMj87GZMs6ThLW79wUzxq2dPEE09UnzXkj+3HpZ5YeS8ozI6et/aj4X 1raL3rMxqCClEMFH6OVXDGy8/rFsT3mdIULeY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=sYyqpDSxywWggvQx7TpwdKRIyHGf8Xu2l05LD1jF1PLKU74D0zQ0+C86yg18ODongX NtDVMIMusqj4ckyX/CmPHG/Ogu4TM6r7xsN9kEgClVsMiR6xoYwsFiFT9UfDTaBGvbo2 fnVEkyBHvjcKo6agiKTXvbPlwkSyYQxnyMLYs= Received: by 10.142.135.16 with SMTP id i16mr1612509wfd.165.1215488368996; Mon, 07 Jul 2008 20:39:28 -0700 (PDT) Received: by 10.142.242.21 with HTTP; Mon, 7 Jul 2008 20:39:28 -0700 (PDT) Message-ID: Date: Mon, 7 Jul 2008 20:39:28 -0700 From: "Jeffrey Baker" To: "Greg Smith" Subject: Re: Practical upper limits of pgbench read/write tps with 8.3 Cc: "pgsql-performance@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/66 X-Sequence-Number: 30666 On Mon, Jul 7, 2008 at 3:22 PM, Greg Smith wrote: > On Mon, 7 Jul 2008, Jeffrey Baker wrote: > >> On the single 2.2GHz Athlon, the maximum tps seems to be 1450...what's the >> bottleneck? Is PG lock-bound? > > It can become lock-bound if you don't make the database scale significantly > larger than the number of clients, but that's probably not your problem. > The pgbench client driver program itself is pretty CPU intensive and can > suffer badly from kernel issues. I am unsurprised you can only hit 1450 > with a single CPU. On systems with multiple CPUs where the single CPU > running the pgbench client is much faster than your 2.2GHz Athlon, you'd > probably be able to get a few thousand TPS, but eventually the context > switching of the client itself can become a bottleneck. On a 2GHz Core 2 Duo the best tps achieved is 2300, with -c 8. pgbench itself gets around 10% of the CPU (user + sys for pgbench is 7s of 35s wall clock time, or 70 CPU-seconds, thus 10%). I suppose you could still blame it on ctxsw between pgbench and pg itself, but the results are not better with pgbench on another machine cross-connected with gigabit ethernet. -jwb