pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Claus Guttesen <kometen@gmail.com>
To: Faludi Gábor <gfaludi@fits.hu>
Cc: pgsql-performance@postgresql.org
Subject: Re: how does pg handle concurrent queries and same queries
Date: Mon, 28 Jul 2008 08:55:53 +0200
Message-ID: <b41c75520807272355m28a5f111re80e17f70ef7d87c@mail.gmail.com> (raw)
In-Reply-To: <000301c8f07d$4bee0f10$e3ca2d30$@hu>
References: <000301c8f07d$4bee0f10$e3ca2d30$@hu>

> I have taken over the maintenance of a server farm , recently. 2 webserver
> on  db server. They are quite powerful 2 processor xeon w/ 6Gig of ram .
>
> Couple of days ago we had a serious performance hit and the db server (pg.
> v7.4) was overloaded w/ something in a way that operating system was almost
> not able to respond or in cases it did not.
>
> After some analysis i suspect that there is a query that takes up to 1
> second and that is the cause. Upon  each page loading this query fires and
> takes the one second and blocks the page to load completly . The load was
> roughly ~300 connections in one minute .
>
> So here are my questions :
>
> ·         Why does the second and the later queries take the whole on second
> if the dataset is the same . Shouldn't PG realise that the query is the same
> so i give the user the same resultset ?
>
> ·         How do I know if one query blocks the other ?
>
> ·         Is there a way to log the long running queries in 7.4 ? If not is
> it available in any newer version ?

Can you post the queries? Can you provide an 'analyze explain'? Do you
perform a 'vacuum analyze' on a regular basis?

-- 
regards
Claus

When lenity and cruelty play for a kingdom,
the gentlest gamester is the soonest winner.

Shakespeare



view thread (7+ messages)  latest in thread

Message-ID: <b41c75520807272355m28a5f111re80e17f70ef7d87c@mail.gmail.com>
Permalink:  ../b41c75520807272355m28a5f111re80e17f70ef7d87c@mail.gmail.com/
Also on:    postgresql.org/message-id/b41c75520807272355m28a5f111re80e17f70ef7d87c@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: kometen@gmail.com, gfaludi@fits.hu
  Subject: Re: how does pg handle concurrent queries and same queries
  In-Reply-To: <b41c75520807272355m28a5f111re80e17f70ef7d87c@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox