2

I am using the .NET Couchbase Client API that includes Enyim.Caching. I have a DataTable that is approximately 55 megs and it is not getting cached. I understand that there is a "soft" max for the item size of 20 megs.

How can I change the default max item size in order to cache this object?

Dan
  • 6,008
  • 7
  • 40
  • 41
DougJones
  • 774
  • 1
  • 9
  • 26
  • 1
    Status code 3 is E2BIG which you should not be getting if the object is less than 20MB. Can you double check the size and also post your code? – mikewied Jan 20 '12 at 18:12
  • Edited question. I put the decimal in the wrong place. It's 55 megs instead of 5.5 megs for the item. Thanks for the help! – DougJones Jan 29 '12 at 00:13

2 Answers2

2

Are you using a Memcached bucket or Couchbase bucket? If you're using a Memcached bucket then you're likely hitting the 1MB limit. A quick sample program:

var config = new CouchbaseClientConfiguration();
config.Urls.Add(new Uri("http://127.0.0.1:8091/pools/default"));
config.Bucket = "memcached";
config.BucketPassword = "qwerty";
var client = new CouchbaseClient(config);

var size = 1000000;
var sb = new StringBuilder();
for (int i = 0; i < size; i++) { sb.Append("z"); };
var data = sb.ToString();
var result = client.Store(StoreMode.Set, "foo", data);
Console.WriteLine(data.Length + ": " + result);

When the size variable is set to 1000000, result is true. When size is set to just over a MB, say 1100000, then result will be false. If you instead use a Couchbase bucket, you can set size to 20000000 and the result will be true. However, setting size to 21000000 will cause the Store operation to fail.

If you're not using a Memcached bucket, please let me know... Also, note that I'm using the .NET 1.0 client with 1.8 server for this sample.

-- John

John Zablocki
  • 1,592
  • 9
  • 6
  • Appreciate the response, but I actually changed the question since I originally miscounted the bytes. I was attempting to store 55 megs and not 5.5 megs, which changed my problem. I am using Couchbase v1.8 with the .NET Couchbase Client API, though. – DougJones Feb 01 '12 at 02:27
  • Is there any way around the 1MB limit when using a Memcached bucket? – Karl Glennon Jun 19 '13 at 13:31
0

Per MikeW from the Couchbase forum post here:

This requires modifying a constant in the source code and building Couchbase yourself.

It seems as if there isn't a way around it. Thanks for the help.

DougJones
  • 774
  • 1
  • 9
  • 26