Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2A9F01337BE4 for ; Wed, 4 May 2011 21:12:51 -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 92062-04 for ; Thu, 5 May 2011 00:12:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from bifrost.lang.hm (mail.lang.hm [64.81.33.126]) by mail.postgresql.org (Postfix) with ESMTP id 758781337B47 for ; Wed, 4 May 2011 21:12:43 -0300 (ADT) Received: from asgard.lang.hm (asgard.lang.hm [10.0.0.100]) by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id p450CUhh004826; Wed, 4 May 2011 17:12:30 -0700 Date: Wed, 4 May 2011 17:12:30 -0700 (PDT) From: david@lang.hm X-X-Sender: dlang@asgard.lang.hm To: Josh Berkus cc: postgres performance list Subject: Re: amazon ec2 In-Reply-To: <4DC1E92D.5020904@agliodbs.com> Message-ID: References: <201105031241.20348.ahodgson@simkin.ca> <201105031309.52154.ahodgson@simkin.ca> <4DC08420.7050602@2ndquadrant.com> <00C0C53C-7042-4C05-B6CD-68BFDF400C76@nasby.net> <4DC1E92D.5020904@agliodbs.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/56 X-Sequence-Number: 43565 On Wed, 4 May 2011, Josh Berkus wrote: > Date: Wed, 04 May 2011 17:02:53 -0700 > From: Josh Berkus > To: postgres performance list > Subject: Re: [PERFORM] amazon ec2 > > >> FWIW, EnterpriseDB's "InfiniCache" provides the same caching benefit. The way that works is when PG goes to evict a page from shared buffers that page gets compressed and stuffed into a memcache cluster. When PG determines that a given page isn't in shared buffers it will then check that memcache cluster before reading the page from disk. This allows you to cache amounts of data that far exceed the amount of memory you could put in a physical server. > > So memcached basically replaces the filesystem? > > That sounds cool, but I'm wondering if it's actually a performance > speedup. Seems like it would only be a benefit for single-row lookups; > any large reads would be a mess. I think it would depend a lot on how well the page compresses. if the network I/O plus uncompression time is faster than the seek and read from disk it should be a win. I don't see why the benifit would be limited to single row lookups, anything within that page should be the same. for multipage actions, the disk would have less of a disadvantage as readahead may be able to hide some of the work while the memcache approach would need to do separate transactions for each page. this does bring up an interesting variation for hierarchical storage, using compressed pages in memcache rather than dedicated resources on a local system. thanks for the thought and I'll keep it in mind. I can think of lots of cases where the database stores a relativly small set of values that would compress well. David Lang