Getting 250 items takes 2 seconds

I am having a Couchbase bucket with 22 million document in it (all small 30 line jsons).
With total size of 7gb of data. It all fits in memory and i even have a 5 gb of memory left for the bucket.

If i do a get with an array of 250 ids it takes about 2 seconds for couchbase to find them. Which is very slow and way longer then i would expect it to cost to fetch 250 document from memory.

// My list of 250 documents to fetch
$idList = ['i::#1100', 'i::#4596', 'i::#7594', 'i::#60947', 'etc'];

// @var \CouchbaseBucket $bucket
$bucket->get($idList, []); // I do not send any options here

// This takes about 2 seconds

Any clue what i am doing wrong?


Hey Jordy,

Are you counting the full time for the script? Or only the time to perform the gets? There is a known period of time when we first connect to couchbase that can take a while. Though 2 seconds still seems quite significant. Can you give us some more detail on your environment?

Cheers, Brett

Hey Brett19 Thanks for replying

The time is for the get only, there was a couchbase connection stabilised before the get (Because i ran another get before this).

To rule out the php code someone suggested to do a “cbc” command on the command line. And that gave about the same time. So the problem look the couchbase node which is configured badly.

It is running on gentoo with 16 cores of 2.27ghz.
It is doing nothing else then serving my test requests.

It just did (the day before) the mass insert of the 22 million documents but i assume couchbase does not really care about it and just works.