Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B0B4D65001C for ; Thu, 24 Jul 2008 04:41:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 42534-08 for ; Thu, 24 Jul 2008 04:40:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from correo2.acens.net (correo2.acens.net [217.116.0.34]) by postgresql.org (Postfix) with ESMTP id 1BC0064FD18 for ; Thu, 24 Jul 2008 04:40:55 -0300 (ADT) Received: (qmail 17664 invoked from network); 24 Jul 2008 07:40:51 -0000 Received: from unknown (HELO sardina) (albert.sedifa.com@[83.175.220.10]) (envelope-sender ) by correo2.acens.net (qmail-ldap-1.03) with SMTP for ; 24 Jul 2008 07:40:51 -0000 From: Albert Cervera Areny Organization: Sedifa, S.L. To: pgsql-performance@postgresql.org, Miernik 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: Thu, 24 Jul 2008 09:38:28 +0200 User-Agent: KMail/1.9.9 References: <20080723152112.30A4.0.NOFFLE@turbacz.local> In-Reply-To: <20080723152112.30A4.0.NOFFLE@turbacz.local> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200807240938.28482.albert@sedifa.com> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/223 X-Sequence-Number: 30823 A Dimecres 23 Juliol 2008, Miernik va escriure: > 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. You didn't mention your PostgreSQL version. Since 8.3 there's "synchronized scans" which greatly improves performance if concurrent queries have to do a sequential scan on the same table. Of course, if queries don't hit the same table there'll be no improvements in performance... > > Any tips in general for running PostgreSQL on such low-resource machine? > > I have: > > shared_buffers = 5MB > work_mem = 1024kB > > are these good values, or could perhaps changing something improve it a > bit? Any other parameters to look at? > > -- > Miernik > http://miernik.name/