X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 518FE9FA5BE for ; Thu, 15 Jun 2006 18:57:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 57428-01 for ; Thu, 15 Jun 2006 18:56:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 0298A9FA13E for ; Thu, 15 Jun 2006 18:56:55 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 15 Jun 2006 21:56:54 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 15 Jun 2006 16:56:54 -0500 Subject: Re: SAN performance mystery From: Scott Marlowe To: Tim Allen Cc: pgsql-performance@postgresql.org In-Reply-To: <4491D61B.9040507@proximity.com.au> References: <4491D61B.9040507@proximity.com.au> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1150408614.26538.95.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 15 Jun 2006 16:56:54 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/328 X-Sequence-Number: 19685 On Thu, 2006-06-15 at 16:50, Tim Allen wrote: > We have a customer who are having performance problems. They have a > large (36G+) postgres 8.1.3 database installed on an 8-way opteron with > 8G RAM, attached to an EMC SAN via fibre-channel (I don't have details > of the EMC SAN model, or the type of fibre-channel card at the moment). > They're running RedHat ES3 (which means a 2.4.something Linux kernel). > > They are unhappy about their query performance. We've been doing various > things to try to work out what we can do. One thing that has been > apparent is that autovacuum has not been able to keep the database > sufficiently tamed. A pg_dump/pg_restore cycle reduced the total > database size from 81G to 36G. Performing the restore took about 23 hours. Do you have the ability to do any simple IO performance testing, like with bonnie++ (the old bonnie is not really capable of properly testing modern equipment, but bonnie++ will give you some idea of the throughput of the SAN) Or even just timing a dd write to the SAN? > We tried restoring the pg_dump output to one of our machines, a > dual-core pentium D with a single SATA disk, no raid, I forget how much > RAM but definitely much less than 8G. The restore took five hours. So it > would seem that our machine, which on paper should be far less > impressive than the customer's box, does more than four times the I/O > performance. > > To simplify greatly - single local SATA disk beats EMC SAN by factor of > four. > > Is that expected performance, anyone? It doesn't sound right to me. Does > anyone have any clues about what might be going on? Buggy kernel > drivers? Buggy kernel, come to think of it? Does a SAN just not provide > adequate performance for a large database? Yes, this is not uncommon. It is very likely that your SATA disk is lying about fsync. What kind of backup are you using? insert statements or copy statements? If insert statements, then the difference is quite believable. If copy statements, less so. Next time, on their big server, see if you can try a restore with fsync turned off and see if that makes the restore faster. Note you should turn fsync back on after the restore, as running without it is quite dangerous should you suffer a power outage. How are you mounting to the EMC SAN? NFS, iSCSI? Other?