What is the recommended way to use getMulti so it works when retrieving >500KB of data?

I am using couchbase nodejs client 2.0.6 and I am running into issues with getMulti calls. If I call getMulti with a lot of ids or data I sometimes get client side timeout failures from it immediately, so I know they are not due to an actual timeout. Message is:
“Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout, code=23, error=21”

I see a lot of posts in this forum about client side timeout issues with the nodejs client, but I tend to only get them when trying to retrieve a lot of data with getMulti. For an example of a lot of data, I can see a recent failure trying to retrieve 41 records at once. 20 succeeded, and 21 said client side timeout. The records being retrieved are pretty large, about 21 KB on average each. The calls don’t always fail and they generally always succeed on my development server, which has a much lower load on it than production, so I don’t know if the problem is all client side or partially server side.

Is there a recommended way to use getMulti on a medium loaded server (about 5 ops every 10 seconds) so that it always works? Am I limited to sending about 10 ids at once?

Hey @alexegli,

Rather than using getMulti to dispatch all your requests concurrently, you can try to spread your requests out over a period of time. I should mention however that the level of load you describe should definitely not be timing out, you may want to investigate reasons that your connection to the server might be significantly slowed, or the server itself being significantly slowed.

Cheers, Brett

It is not actually timing out though. The error occurs immediately, so unless the timeout is by default set to less than 1 second it is not a timeout, it’s just seems to be the default error the couchbase nodejs client displays. The nodejs client is on the same machine as the database, so it is running a localhost query. The actual data could be stored on a different node in the cluster, but my understanding of couchbase was that where the data was stored would not cause an issue. All nodes in the cluster are in the same timezone though, and there are only 2 nodes.

I’ve done some more extensive testing and I am having a lot of trouble reproducing the issue. Which makes me think it’s load related and more on the server side than the client side, or possibly in the server setup and the number of connections allowed. I think your solution of staggering the requests individually without using getMulti is probably the safest.