Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E8684632592 for ; Wed, 30 Jun 2010 13:43:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 60110-09 for ; Wed, 30 Jun 2010 16:42:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f46.google.com (mail-bw0-f46.google.com [209.85.214.46]) by mail.postgresql.org (Postfix) with ESMTP id 945A563256E for ; Wed, 30 Jun 2010 13:42:52 -0300 (ADT) Received: by bwz1 with SMTP id 1so475648bwz.19 for ; Wed, 30 Jun 2010 09:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=iv3SoKvYSzUjYsZ2D53+9EjKss+T/FyKvlMvnABTl7I=; b=ZsL2s5odpD4ap2y9WWLMZUDE9ltzZaIH2hwUFQDUEoHRUt2tCcN1wBDTv9bFwC2b2F pDpevegsd/mJPjwYglV2Hx0wh0KwS9GNxA6Wi9jqqTGN4kCyNXGNrkUJyy+JP8vK5a6U OZPe5gLIvp5rkiCz7lY1kwtA83HjraE9HHJCI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=F9CCjovaVNqJ3cq1DkJBRiBlWsG0yo081tgFxK9Wj7XH1cNAEZKiA85tx2TgX/Zx+A 4yRUtz7hzykfM95WbJ2pQKrmcz5BoREacqORjR8P/9cm9WhtS5AL3U3yqG9Rgh9g9JTB HnogFb6InscYzwY5eB55Ie/8d0WeIbdHkS73g= MIME-Version: 1.0 Received: by 10.204.54.200 with SMTP id r8mr846291bkg.40.1277916170761; Wed, 30 Jun 2010 09:42:50 -0700 (PDT) Received: by 10.204.116.18 with HTTP; Wed, 30 Jun 2010 09:42:50 -0700 (PDT) In-Reply-To: References: Date: Wed, 30 Jun 2010 11:42:50 -0500 Message-ID: Subject: Re: PostgreSQL as a local in-memory cache From: Dave Crooke To: "jgardner@jonathangardner.net" Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=001636c5b285693880048a420b5e X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=BAYES_40=-0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201006/528 X-Sequence-Number: 39384 --001636c5b285693880048a420b5e Content-Type: text/plain; charset=UTF-8 I haven't jumped in yet on this thread, but here goes .... If you're really looking for query performance, then any database which is designed with reliability and ACID consistency in mind is going to inherently have some mis-fit features. Some other ideas to consider, depending on your query mix: 1. MySQL with the MyISAM database (non-ACID) 2. Put an in-application generic query cache in front of the DB, that runs in the app address space, e.g. Cache' if using Java 3. Using a DB is a good way to get generic querying capability, but if the "where" clause in the querying is over a small set of meta-data, and SQL syntax is not a big requirement, consider non-RDBMS alternatives, e.g. use XPath over a W3C DOM object tree to get primary keys to in-memory hash tables (possibly distributed with something like memcached) On Mon, Jun 14, 2010 at 9:14 PM, jgardner@jonathangardner.net < jgardner@jonathangardner.net> wrote: > We have a fairly unique need for a local, in-memory cache. This will > store data aggregated from other sources. Generating the data only > takes a few minutes, and it is updated often. There will be some > fairly expensive queries of arbitrary complexity run at a fairly high > rate. We're looking for high concurrency and reasonable performance > throughout. > > The entire data set is roughly 20 MB in size. We've tried Carbonado in > front of SleepycatJE only to discover that it chokes at a fairly low > concurrency and that Carbonado's rule-based optimizer is wholly > insufficient for our needs. We've also tried Carbonado's Map > Repository which suffers the same problems. > > I've since moved the backend database to a local PostgreSQL instance > hoping to take advantage of PostgreSQL's superior performance at high > concurrency. Of course, at the default settings, it performs quite > poorly compares to the Map Repository and Sleepycat JE. > > My question is how can I configure the database to run as quickly as > possible if I don't care about data consistency or durability? That > is, the data is updated so often and it can be reproduced fairly > rapidly so that if there is a server crash or random particles from > space mess up memory we'd just restart the machine and move on. > > I've never configured PostgreSQL to work like this and I thought maybe > someone here had some ideas on a good approach to this. > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > --001636c5b285693880048a420b5e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I haven't jumped in yet on this thread, but here goes ....

If yo= u're really looking for query performance, then any database which is d= esigned with reliability and ACID consistency in mind is going to inherentl= y have some mis-fit features.

Some other ideas to consider, depending on your query mix:

1. My= SQL with the MyISAM database (non-ACID)

2. Put an in-application gen= eric query cache in front of the DB, that runs in the app address space, e.= g. Cache' if using Java

3. Using a DB is a good way to get generic querying capability, but if = the "where" clause in the querying is over a small set of meta-da= ta, and SQL syntax is not a big requirement, consider non-RDBMS alternative= s, e.g. use XPath over a W3C DOM object tree to get primary keys to in-memo= ry hash tables (possibly distributed with something like memcached)

On Mon, Jun 14, 2010 at 9:14 PM, jgardner@jonathangardner.net <jgardner@j= onathangardner.net> wrote:
We have a fairly = unique need for a local, in-memory cache. This will
store data aggregated from other sources. Generating the data only
takes a few minutes, and it is updated often. There will be some
fairly expensive queries of arbitrary complexity run at a fairly high
rate. We're looking for high concurrency and reasonable performance
throughout.

The entire data set is roughly 20 MB in size. We've tried Carbonado in<= br> front of SleepycatJE only to discover that it chokes at a fairly low
concurrency and that Carbonado's rule-based optimizer is wholly
insufficient for our needs. We've also tried Carbonado's Map
Repository which suffers the same problems.

I've since moved the backend database to a local PostgreSQL instance hoping to take advantage of PostgreSQL's superior performance at high concurrency. Of course, at the default settings, it performs quite
poorly compares to the Map Repository and Sleepycat JE.

My question is how can I configure the database to run as quickly as
possible if I don't care about data consistency or durability? That
is, the data is updated so often and it can be reproduced fairly
rapidly so that if there is a server crash or random particles from
space mess up memory we'd just restart the machine and move on.

I've never configured PostgreSQL to work like this and I thought maybe<= br> someone here had some ideas on a good approach to this.

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

--001636c5b285693880048a420b5e--