Re: Long running queries degrade performance

From: Chris Kratz <chris(dot)kratz(at)vistashare(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Long running queries degrade performance
Date: 2004-04-16 21:26:32
Message-ID: 200404161726.32102.chris.kratz@vistashare.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Friday 16 April 2004 5:12 pm, Tom Lane wrote:
> Chris Kratz <chris(dot)kratz(at)vistashare(dot)com> 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Litao Wu 2004-04-16 21:45:29 sunquery and estimated rows
Previous Message Tom Lane 2004-04-16 21:12:52 Re: Long running queries degrade performance