X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8A4A7D1E298 for ; Fri, 16 Apr 2004 18:26:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 92168-03 for ; Fri, 16 Apr 2004 18:26:28 -0300 (ADT) Received: from mail.vistashare.com (www.vistashare.net [65.207.67.162]) by svr1.postgresql.org (Postfix) with ESMTP id BDD12D1E2A7 for ; Fri, 16 Apr 2004 18:26:30 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vistashare.com (Postfix) with ESMTP id 38CF19586 for ; Fri, 16 Apr 2004 17:26:33 -0400 (EDT) From: Chris Kratz Organization: VistaShare To: pgsql-performance@postgresql.org Subject: Re: Long running queries degrade performance Date: Fri, 16 Apr 2004 17:26:32 -0400 User-Agent: KMail/1.6.2 References: <200404161128.00851.chris.kratz@vistashare.com> <2850.1082149972@sss.pgh.pa.us> In-Reply-To: <2850.1082149972@sss.pgh.pa.us> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404161726.32102.chris.kratz@vistashare.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/228 X-Sequence-Number: 6528 On Friday 16 April 2004 5:12 pm, Tom Lane wrote: > Chris Kratz writes: > > ... Or if worse comes to worse to actually kill long running > > processes without taking down the whole db as we have had to do on > > occasion. > > A quick "kill -INT" suffices to issue a query cancel, which I think is > what you want here. You could also consider putting an upper limit on > how long things can run by means of statement_timeout. Wow, that's exactly what I've been looking for. I thought I had scoured the manuals, but must have missed that one. I need to think about the statement_timeout, the might be a good idea to use as well. > Those are just band-aids though. Not sure about the underlying problem. > Ordinarily I'd guess that the big-hog queries are causing trouble by > evicting everything the other queries need from cache. But since your > database fits in RAM, that doesn't seem to hold water. That makes some sense, perhaps there is some other cache somewhere that is causing the problems. I am doing some tuning and have set the following items in our postgresql.conf: shared_buffers = 4096 max_fsm_relations = 1000 max_fsm_pages = 20000 sort_mem = 2048 effective_cache_size = 64000 I believe these are the only performance related items we've modified. One thing I did today, since we seem to run about 600M of memory available for file caches. The effective cache size used to be much lower, so perhaps that was causing some of the problems. > What PG version are you running? 7.3.4 with grand hopes to move to 7.4 this summer. > regards, tom lane -- Chris Kratz Systems Analyst/Programmer VistaShare LLC www.vistashare.com