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

Low Couchbase RAM Utilization

2 replies [Last post]
  • Login or register to post comments
Fri, 08/17/2012 - 16:24
osterman
Offline
Joined: 08/16/2012
Groups: None

We have allocated 108GB to a single bucket 'default' for a dataset which is 145GB on disk. We never see more than 70G RAM in use, leaving 38GB wasted. Is there a way to tune how much couchbase loads into memory?

Thanks!

Erik

Top
  • Login or register to post comments
Wed, 08/22/2012 - 10:24
mikew
Offline
Joined: 03/14/2011
Groups:

Couchbase uses a concept of high and low watermarks that are set at 80% and 65% respectively. If you continue to add data or do get requests where the item happens to be on disk then you will see that you memory usage will increase up to 86 GB. At this point the item pager will kick in and remove 16GB or data using an LRU like algorithm. If your cluster is under really heavy load then you will see the memory usage go up to around 100GB.

As you pointed out the high and low watermarks cause memory to be unused during periods of time and in future releases of Couchbase we will remove them.

If you would like to modify these watermarks then you can change them with

Depending on your release you will use one of these scripts

./cbepctl localhost:11210 set flush_param mem_high_wat <value in bytes>
./cbepctl localhost:11210 set flush_param mem_low_wat <value in bytes>

or

./cbflushctl localhost:11210 set flush_param mem_high_wat <value in bytes>
./cbflushctl localhost:11210 set flush_param mem_low_wat <value in bytes>

Top
  • Login or register to post comments
Fri, 08/31/2012 - 17:22
osterman
Offline
Joined: 08/16/2012
Groups: None

Thanks! We'll give this a try.

Also, if it helps anyone else, here's how you can get current limits:

cbstats localhost:11210 all | grep  -e max_data_size -e mem_high_wat -e mem_low_wat

For more information about how the watermarks are used, read here:
http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-architectur...


As the system is loaded with data, eventually the mem_low_wat is passed. At this time, no action is taken. This is the "goal" the system will move toward when migrating items to disk. As data continues to load, it will evenutally reach mem_high_wat. At this point a background job is scheduled to ensure items are migrated to disk and the memory is then available for other Couchbase Server items. This job will run until measured memory reaches mem_low_wat. If the rate of incoming items is faster than the migration of items to disk, the system may return errors indicating there is not enough space. This will continue until there is available memory.

To dynamically set them based on percentages, we did:

# Set high/low water marks
mem_high_wat=$(ruby -e 'puts (%x{cbstats localhost:11210 all|grep max_data_size}.split(/[: ]+/)[2].to_i * 0.95).to_i')
mem_low_wat=$(ruby -e 'puts (%x{cbstats localhost:11210 all|grep max_data_size}.split(/[: ]+/)[2].to_i * 0.90).to_i')
 
cbflushctl localhost:11210 set mem_high_wat $mem_high_wat 
cbflushctl localhost:11210 set mem_low_wat $mem_low_wat

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