Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.6.x

How to warm up RAM storage

1 reply [Last post]
  • Login or register to post comments
Thu, 02/24/2011 - 14:50
sebastian
Offline
Joined: 02/16/2011
Groups: None

Hi,

I'd like to know how to warm up the RAM cached copy of some keys stored in the disk database.

My use case is serving images, so for example when the server is generating the html page with say 10 images in it, it knows right away that those 10 images are going to be requested once the browser parses the html page, one request for each 'img' html tag. So I would like to use the time it takes to send the page through the network, parse it in the browser, and again the latency to the image server for the 10 requests, to warm membase RAM copy with those 10 images.

I am thinking in spawning a component that hits membase while the page is being sent by the web server, so I guarantee that the images are going to be already in RAM (if they were in spinning disks), effectively reducing the disk seek time for each image.

I can't afford right now to have a copy of each image in RAM, that's why I want at least to improve the waiting time as much as I can.

I am wondering what's the best way to do it, from the documentation it says that the tiered storage (RAM and one type of disk so far) uses an LRU cache. I guess that I could do a GET(s) on the keys I want and then the images are going to be temporarily in RAM, so when the requests arrive they would be served from RAM. Is this reasoning correct? Is it a deterministic LRU algorithm, I mean no optimizations that would decide to drop some items not in LRU order some time?

Is there a way to make the images be taken to RAM without actually getting them? like a "exists" command that copies the value to RAM if it's not there. Any other ideas that could help in this use case?

Thanks,
Sebastian.
 

Top
  • Login or register to post comments
Fri, 02/25/2011 - 10:00
perry
Offline
Joined: 10/11/2010
Groups:

 Sebastian, you're best bet is to use a 'multi-get' on the list of keys for those images.  They will be brought to RAM and you could actually ignore the return values for the first request.

 

Perry

__________________

Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker