Testing Couchbase Server

Testing Couchbase Server

Testing the connection to Couchbase Server can be performed in a number of different ways.

Connecting to the Couchbase web console on a node via a web browser provides basic confirmation that your node is available. You can also use the couchbase-cli command to query your Couchbase Server node to confirm that the node is available.

Note: The Couchbase web console uses the same port as smart clients when communicating with Couchbase Server. If you can connect to the Couchbase web console from a particular machine then administration and database clients on the same machine can also connect to the core cluster port and perform operations. The Couchbase web console will warn if the web browser loses connectivity to the node.

To verify that clients can connect to your node, you can use either the cbworkloadgen command, or telnet.

The cbworkloadgen command is a python program which performs basic operations (reads and writes) against the Couchbase Server cluster.

Using telnet only checks the memcached compatibility ports and the memcached text-only protocol.

Testing with telnet

The simplest method to determine whether Couchbase Server is running is to use Telnet to connect to the server with the memcached text protocol.

Telnet must be installed on your server to connect to Couchbase Server using this method. It is supplied as standard on most platforms, or can be obtained as a separate package and installed via your operating system's standard package manager.

Note: You should not use the Telnet method for communicating with your server within your application. Instead, use one of the Couchbase Server SDKs.

Connect to the server (via the legacy memcached protocol using Moxi):

> telnet localhost1 11211
        Connected to localhost.localdomain (
        Escape character is '^]'.

Make sure it is responding (stats is a great way to check basic health):

        STAT delete_misses 0
        STAT ep_io_num_write 0
        STAT rejected_conns 0
        STAT time 1286678223
        STAT curr_items_tot 0
        STAT threads 4
        STAT pid 23871

Store a document:

set test_key 0 0 1

Retrieve the document:

get test_key
        VALUE test_key 0 1


        Connection closed by foreign host.

All of the memcached protocol's commands will work through Telnet.

Testing with cbworkloadgen

The command cbworkloadgen generates random data then performs reads and writes on this data in Couchbase Server. It is not intended to be a performance benchmarking tool.

To test a Couchbase Server installation using cbworkloadgen, execute the following command, supplying the IP address of the running node:

> cbworkloadgen -n [host]:8091
        Thread 0 - average set time : 0.0257480939229 seconds , min : 0.00325512886047 seconds , max : 0.0705931186676 seconds , operation timeouts 0

The progress and activity of the tool can also be monitored within the Couchbase web console.

Further details about cbworkloadgen can be found on its CLI reference page.