We’re trying to use CB as caching layer for our image storage. It uses nginx + lua + memc module.
We’re able to set and get images via couchbase.
After looking the logs, turned out we can’t set key / value larger than 1MB, we’re getting error:
SERVER ERROR object too large for cache
But the limits page of CB says that the limit is 20MB. What we’re missing here?
Kurt
The bucket type is couchbase, not memcache
There is 3GB RAM empty on CB, actually we flush everything and just trying to set one file with 1.1MB size.
Image with 0.96 MB was success.
The method we’re using is memc:set(url, img.body)
The version installed: couchbase-server-enterprise-3.0.2-centos6.x86_64.rpm
Just installed and tried with couchbase-server-community-3.0.1-centos6.x86_64.rpm.
Still the same error: "SERVER_ERROR object too large for cache"
I catch this error over tcpdump btw, the lua client says only “nil” as output
Firstly let me confirm that your understanding is absolutely correct - Couchbase is configured to store items up to 20MB in size. We can run a simple test to determine if your Couchbase cluster is behaving correctly using one of our standard load generator tools, pillowfight.
With the following commands I attempt to store a single item of ~10M, ~20M and ~30M to Couchbase.
$ cbc-pillowfight -m 10000000 -M 10000000 -t 1 -I 1 -U couchbase://192.168.105.101/charlie -B 1 -p BIG_ITEM_1 -c1
Running. Press Ctrl-C to terminate...
Thread 0 has finished populating.
$ cbc-pillowfight -m 20000000 -M 20000000 -t 1 -I 1 -U couchbase://192.168.105.101/charlie -B 1 -p BIG_ITEM_2_ -c1
Running. Press Ctrl-C to terminate...
Thread 0 has finished populating.
$ cbc-pillowfight -m 30000000 -M 30000000 -t 1 -I 1 -U couchbase://192.168.105.101/charlie -B 1 -p BIG_ITEM_3_ -c1
Running. Press Ctrl-C to terminate...
Thread 0 has finished populating.
Operation(s) failed: [0x4] The object requested is too big to store in the server
These commands store a single document on Couchbase of the specified size to my bucket named “charlie”. The cbc-pillowfight tool is installed as part of the libcouchbase installation.
Note the first two succeed whilst the third write fails. Running these commands to your cluster you should see the same behaviour. If not, we can take a closer look at the Server configuration to understand why it might be giving that response.
If pillowfight can successfully store large enough documents to Couchbase then that certainly suggests the problem is on the client end. It would be worth trying the lua-couchbase repo to see if your experience differs.
We’re suspecting the very same thing, but on the other hand we’re receiving the “SERVER_ERROR object too large for cache” from the server, right after the set command. Hmm…
Yes @avsej , during weekend I’m 100% sure now that the lua library memc is using the legacy methods.
@owen_hughes I tried nodejs, it’s working but we’re not 100% familiar with nodejs itself and other languages mentioned in SDK will create blocking io and would create more issues. Simple Nginx + Lua would be best and simple way to handle a lot of traffic. I found this: http://labs.couchbase.com/couchbase-nginx-module but it has very little information about how to set and get binary files, I know I should use the body for $couchbase_val but it’s not accepting it. Any idea how I can reach to this repo holder?
I tried the client side moxi and with moxi-cluster.cfg I’m now able to set files more than 1MB. Is there a way to configure the builtin moxi to set the paramenter url=http://HOSTNAME:8091/pools/default/bucketsStreaming/default ?
I’ve uploaded a patch for review and it’ll be fixed in the next release. I don’t know if we’ll issue a patch for existing releases. Please connect through your support channels if you need one.