2ms or 40ms for random gets

Aha, so the time includes bootstrapping as well. This largely depends on which node you actually connect to.

When the client connects to the cluster, it will initially connect to only one node. The node it connects to is random (since you’re randomizing the list), and the node that the key is mapped to depends on the node (what the key’s vBucket is).

In the best case scenario, the node which the client bootstraps from is the same node which is the master for the key you query, in this case there is only a single TCP connection to establish.

Each connection to a node involves a negotiation process which is around 2-3 network round trips; an actual get is only 2 network round trips; thus in the case where all you do is connect to a cluster and fetch an item, the overhead of the negotiation is greater than the overhead of actually fetching the item.

There are some features you can use in order to reduce the time it takes to perform the bootstrap process; mainly the configuration cache, which eliminates the bootstrap process in most cases. See http://docs.couchbase.com/developer/c-2.4/options.html and search for config_cache on that page. (This is the documentation for the connection string which is available in PHP and parsed by the C library).