Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id CA67E2E0299 for ; Sun, 2 Dec 2007 17:46:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 76270-04 for ; Sun, 2 Dec 2007 17:46:27 -0400 (AST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by postgresql.org (Postfix) with ESMTP id 953122E00C8 for ; Sun, 2 Dec 2007 17:46:27 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so2167181nfh for ; Sun, 02 Dec 2007 13:46:26 -0800 (PST) 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=kg3aMWlsq57Ewf1s99ypH5ta/cGR+ymD9yWDMaL8iOU=; b=JHNeptdwmrTPbNIzlkn39fkmHPDgTY/1clFd9pqgO4tZBT3df8woesuia4mjJxQU26uN7H7zNw171f1gBB5eq4ce8ZwHquz8fu4hANUqDovTs8BjdT1Ihl7Y20ubTc4j5CfFNeBIRH58guT74p8jfA659zRPS5RdEgcgmgGQPws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=K4I47VWvpbe3aHGn58jH2gO9wFYj51A0kyUjDr09J5NGdEH3jvNjHbCwwrsSeFY2tXpyhN4UzAEiCMkPRm+HdzKNMX7RFrdTdEJ5EEVOo7152vMMbuRBuQH+M20yR3USJfSfIEn8YDEz7wifBoo08VdqLo86e3dXD6svJfTGjIw= Received: by 10.78.170.6 with SMTP id s6mr872035hue.1196631985579; Sun, 02 Dec 2007 13:46:25 -0800 (PST) Received: by 10.78.35.7 with HTTP; Sun, 2 Dec 2007 13:46:25 -0800 (PST) Message-ID: <162867790712021346p248e8476nc087699b09fc2c90@mail.gmail.com> Date: Sun, 2 Dec 2007 22:46:25 +0100 From: "Pavel Stehule" To: "Beyers Cronje" Subject: Re: PostgreSQL 8.2.5 slow performance on INSERT on Linux Cc: pgsql-performance@postgresql.org In-Reply-To: <329bff5c0712021334k474483bav278f79e7e27b26ac@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <329bff5c0712021334k474483bav278f79e7e27b26ac@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/16 X-Sequence-Number: 27832 On 02/12/2007, Beyers Cronje wrote: > Hi all, > > I'm busy evaluating PostgreSQL and I'm having performance problems on one of > my servers. I have a very simple one table database, and the client using > Mono 1.2.5.1 is running a loop doing INSERTs on the table. Initially I > tested this on my development PC, an old P4 system with 2GB RAM and 10,000 > INSERTs took ~12 secs on average, which I was fairly satisfied with. I then > moved everything over to our test server, a new Dell 1950 server with quad > core Xeon processors, 4GB RAM and SCSI hdd expecting to see better > performance, but instead performance dropped to ~44 secs for 10,000 INSERTs. > This obviously is not acceptable. Both the PC and server are running the > exact same PostgreSQL version, Mono version, client application and both > tests were run under very low load and on an empty table. I noticed that CPU > utilization on the Dell server is very low, 1-2% utilization, so obviously > it's not a load problem. Only the test application is accessing the > database. > > So my question is, can anyone please give me some tips on what commands or > tools I can use to try and pin down where exactly the performance drop is > coming from? I'm obviously new to PostgreSQL so even basic checks can be > relevant. > > Kind regards > > Beyers Cronje > Hello a) use COPY instead INSERT (it's much faster) if it is possible b) check your configuration and read this article http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm Regards Pavel Stehule