Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 0C2B59FB1E1 for ; Wed, 25 Oct 2006 15:23:50 -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 34430-01-4 for ; Wed, 25 Oct 2006 15:23:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id 5D3A89FB266 for ; Wed, 25 Oct 2006 15:19:13 -0300 (ADT) Received: from alvh.no-ip.org (201-220-123-102.bk10-dsl.surnet.cl [201.220.123.102]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k9PIJE2K011662; Wed, 25 Oct 2006 11:19:14 -0700 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 1EE13C37184; Wed, 25 Oct 2006 15:19:10 -0300 (CLST) Date: Wed, 25 Oct 2006 15:19:10 -0300 From: Alvaro Herrera To: Carlo Stonebanks Cc: pgsql-performance@postgresql.org Subject: Re: commit so slow program looks frozen Message-ID: <20061025181910.GW26407@alvh.no-ip.org> Mail-Followup-To: Carlo Stonebanks , pgsql-performance@postgresql.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Wed, 25 Oct 2006 11:19:15 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.947 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/526 X-Sequence-Number: 21655 Carlo Stonebanks wrote: > The delays are so long that I used to think the app was hopelessly frozen. > By accident, I left the app alone in its frozen state and came back a good > deal later and seen that it was running again. > > Sometimes I decide it *IS* frozen and have to restart. Because Ctrl-C will > not cause the script to break, it appears the app is stuck in non-TCL code > (either waiting for postgres or stuck in the interface code?) You may try to figure out what's the process doing (the backend obviously, not the frontend (Tcl) process) by attaching to it with strace. Is it doing system calls? Maybe it's busy reading from or writing to disk. Maybe it's swamped by a context switch storm (but in that case, probably the other processes would be affected as well). Or you may want to attach to it with GDB and see what the backtrace looks like. If nothing obvious pops up, do it several times and compare them. I wouldn't expect it to be stuck on locks, because if it's only on commit, then it probably has all the locks it needs. But try to see if you can find something not granted in pg_locks that it may be stuck on. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support