Re: how to fix problem then when two queries run at the same time, it takes longer to complete then if run in sequence

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Miernik <public(at)public(dot)miernik(dot)name>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: how to fix problem then when two queries run at the same time, it takes longer to complete then if run in sequence
Date: 2008-07-23 19:30:48
Message-ID: 20080723193048.GB3580@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Miernik wrote:
> I have a PostgreSQL database on a very low-resource Xen virtual machine,
> 48 MB RAM. When two queries run at the same time, it takes longer to
> complete then if run in sequence. Is there perhaps a way to install
> something like a query sequencer, which would process queries in a FIFO
> manner, one at a time, even if a new query comes before the last one
> running is finished, it would not give the new query to the server
> before the one running now finishes? That would greatly improve
> performance.

One idea I just had was to have a connection pooler (say pgpool) and
allow only one connection slot. If the pooler is capable to be
configured to block new connections until the slot is unused, this would
do what you want. (I don't know whether poolers allow you to do this).

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeffrey Baker 2008-07-23 19:57:34 Re: Samsung 32GB SATA SSD tested
Previous Message Scott Marlowe 2008-07-23 17:25:35 Re: how to fix problem then when two queries run at the same time, it takes longer to complete then if run in sequence