first connection latency ?
I'm evaluating Couchbase for storing users' sessions (with php).
It seems slower than Memcache at establishing the connection, (then it's actually faster but for storing/getting session I don't care about this, it just has to be fast).
Example code :
// couchbase $timebegin = microtime(); $cb = new Couchbase("127.0.0.1:8091"); $cb->set("a", 1); echo $cb->get('a') . '<br>'; echo microtime() - $timebegin . '<br>'; echo '<hr>'; // memcache $timebegin = microtime(); $memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Could not connect"); $memcache->set('b', 1, false, 10) or die ("Failed to save data at the server"); echo $memcache->get('b') . '<br>'; echo microtime() - $timebegin . '<br>';
This code gives :
1 0.014868 1 0.000843
I'm using the default bucket, default install (I did not change anything). The connection seems slow, and I cannot find a way to optimize it in the documentation. I understand that there is overhead because of the time needed to get the correct node in the cluster etc...
=> Am I doing something wrong ?
=> Would you use it for session storage ?