CouchbaseEnvironment configuration

Hi Folks !

I’d like to know what’s your thoughts are about setting the kvEndpoints = 2 ?

I am seeing many timeoutExceptions in production environment ( CB server 4.2, Java SDK 2.4.7 ).
I did some local stress tests, hitting like 30K ops/sec in average and i was able to reproduce the timeout Exception with a local CB server .
By incrementing kbEndpoints to 2 i am not seeing any timeout and CB server seems to be responding really fast.

That’s why i would like to know what’s your experience with this property ?

The operations that i am doing is a bulkGet.

@german.barros if in your testing this helps with the problem, its a sensible way to do. What it does it will open 2 instead of one keyvalue connection per couchbase server, so you are basically doubling your pipes downstream. Very often that throughput is not the issue, but especially in bulk operations like yours it can make sense to sensibly tune it.

Cool ! Thanks for the quick response. I was a bit concern incrementing it because the documentation say:

"By default, for every node in the cluster one socket is opened where all traffic is pushed through. That way the SDK implicitly benefits from network batching "

What kind of benefits is talking about when using kvEndpoints = 1 ?

Beyond the 2 sockets per node, do you think could be any other risk incrementing this value ?

Well, what happens if you have many small docs, or a very interactive (not batch) worload is that if you have 1 socket used from many app threads it can internally batch it up into one tcp packet, use less syscalls to flush/write down to the OS and so forth. So basically as long as all data fits into one “pipe” thats more efficient. If like in your case you are flooding the pipe it gets full and stuff queues up (and then if it takes too long times out). Since we can’t build a bigger pipe ( :wink: ) we can add another one like you did.

Great !!! Thank you so much !

1 Like

Glad I could clear it up! happy coding :slight_smile: