Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6CE476323B8 for ; Mon, 31 May 2010 13:59:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 81537-05 for ; Mon, 31 May 2010 16:59:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 6D88F6323B0 for ; Mon, 31 May 2010 13:59:36 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o4VGxYYj014832; Mon, 31 May 2010 12:59:34 -0400 (EDT) To: Dale Gallagher cc: pgsql-admin@postgresql.org Subject: Re: Strange behaviour: create database hangs (v 8.4.4) In-reply-to: References: Comments: In-reply-to Dale Gallagher message dated "Mon, 31 May 2010 13:31:42 +0200" Date: Mon, 31 May 2010 12:59:34 -0400 Message-ID: <14831.1275325174@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/303 X-Sequence-Number: 34776 Dale Gallagher writes: > On 31 May 2010 13:10, Dale Gallagher wrote: >> I am now using strace on postgres startup and watching the filesystem >> during the creation of the database. So far, it seems that files in >> PGHOME/base/1234/ are appearing, but VERY slowly. Thus far it's taken >> 7 minutes and 92 files have been created. The command has not >> completed within psql.... >> >> Could this be a filesystem corruption issue? The host is using ext4. > The command finally completed. It took a VERY long time. Something is > wrong, but I have no clue what. Seems like you must have a kernel/filesystem issue, but I don't know what either. CREATE DATABASE just copies the contents of template1 using some absolutely straightforward code (look into src/port/copydir.c) so it's entirely filesystem-limited. You could try tracing the backend that's doing the command with "strace -r -p " to try to get an idea of which system calls are eating all the time. regards, tom lane