Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
10.5 Couchbase APIs
Chapter Sections
Chapters

10.5.1. memcached protocol

10.5.1.1. memcapable 1.0

Couchbase Server supports the textual memcached protocol as described in protocol.txt. The textual protocol is disabled for the direct port to Couchbase Server due to the lack of vBucket support in couchbase. All access to Couchbase Server with the textual protocol must go through moxi.

One minor difference with Couchbase Server compared to memcached is that Couchbase Server allows for larger item sizes. Where memcached is 1MByte by default (tunable in more recent versions), Couchbase Server defaults to a maximum item size of 20MByte.

10.5.1.1. memcapable 1.0

memcapable is a tool included in lib memcached that is used to verify if a memcached implementation adheres to the memcached protocol. It does this by sending all of the commands specified in the protocol description and verifies the result. This means that the server must implement an actual item storage and all of the commands to be able to pass the memcapable testsuite.

10.5.1.1.1. Command line options

memcapable supports a number of command line options you may find useful (try running memcapable-h to see the list of available options). If you run memcapable without any options it will try to connect to localhost:11211and run the memcapable testsuite (see Section 10.5.1.1.2, “Example”). If you're trying to implement your own server and one of the tests fails, you might want to know why it failed. There is two options you might find useful for that: -v or-c. The -v option prints out the assertion why the test failed, and may help you figure out the problem. I'm a big fan of debuggers and corefiles, so I prefer -c. When using-c memcapable will dump core whenever a test fails, so you can inspect the corefile to figure out why the test failed.

10.5.1.1.2. Example

The following example tests the server listening on port 11211 on the local host (in this example I've got the stock memcached server running there)

shell> memcapable
ascii quit [pass]
ascii version [pass]
ascii verbosity [pass]
ascii set [pass]
ascii set noreply [pass]
ascii get [pass]
ascii gets [pass]
ascii mget [pass]
ascii flush [pass]
ascii flush noreply [pass]
ascii add [pass]
ascii add noreply [pass]
ascii replace [pass]
ascii replace noreply [pass]
ascii CAS [pass]
ascii CAS noreply [pass]
ascii delete [pass]
ascii delete noreply [pass]
ascii incr [pass]
ascii incr noreply [pass]
ascii decr [pass]
ascii decr noreply [pass]
ascii append [pass]
ascii append noreply [pass]
ascii prepend [pass]
ascii prepend noreply [pass]
ascii stat [pass]
binary noop [pass]
binary quit [pass]
binary quitq [pass]
binary set [pass]
binary setq [pass]
binary flush [pass]
binary flushq [pass]
binary add [pass]
binary addq [pass]
binary replace [pass]
binary replaceq [pass]
binary delete [pass]
binary deleteq [pass]
binary get [pass]
binary getq [pass]
binary getk [pass]
binary getkq [pass]
binary incr [pass]
binary incrq [pass]
binary decr [pass]
binary decrq [pass]
binary version [pass]
binary append [pass]
binary appendq [pass]
binary prepend [pass]
binary prependq [pass]
binary stat [pass]
All tests passed

The following example runs the test named "binary prepend"

trond@opensolaris> memcapable -T "binary prepend"
binary prepend [pass]
All tests passed

The following example runs the test suite, but prompts the user before each test

trond@opensolaris> memcapable -P ascii quit
Press <return> when you are ready?
ascii quit [pass]
ascii version
Press <return> when you are ready? quit