DESCRIPTION

Ability to customize the waiting strategy for requests/repsonses on ring buffer.

I have observed that the default strategy (BlockingWaitStrategy) is slowing down The Java client at high throughput rates.
Other alternatives are available which can be use to tune the Java client performance.

Change-Id: I1558fbab2ad5c0c46785de67920a715dc48e50eb


COMMENTS

author: Gianna Garza
date: 2016-05-10 12:26:37.267000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2016-05-10 12:29:55.626000000

Patch Set 1:

thanks for your contribution!

I've heavily experimented with those as well but I could not get a significant bump under many use cases - which workload pattern do you have and what strategy gives better perf for you?

I'll review the changeset in a separate comment :)

-------------------------------------
author: Gianna Garza
date: 2016-05-10 13:21:37.960000000

Patch Set 1:

I haven't tested all of the strategies, actually only YieldingWaitStrategy was the strategy I've used.
I have tested it in an isolated environment embedding java client into HTTP REST service: 
Pros of YWS:
 - much better response times (x4 or even more) at high HTTP requests rate per second (3-5k rps)
Cons of YWS:
 - consumes 2 cores of CPU when in IDLE state (no incoming HTTP requests)
 - requires 4 cored machine per app instance

-------------------------------------
author: Estrella Humphrey
date: 2016-05-10 13:42:54.990000000

Patch Set 1:

This looks good to me from a high standpoint. I opened a JIRA ticket to track this: https://issues.couchbase.com/browse/JVMCBC-335

The commit message would need to be brought in line with the format we usually use (but we can do that just before merging).

Also this would need an associated change in java-client, as the CouchbaseEnvironment must have an overload of the new builder method.

-------------------------------------
author: Estrella Humphrey
date: 2016-05-10 13:43:12.833000000

Patch Set 1:

Mariusz, can you confirm that you have signed the CLA?

-------------------------------------
author: Gianna Garza
date: 2016-05-10 13:48:13.108000000

Patch Set 1:

I have signed the CLA.
I will change the commit message and check the java-client.

-------------------------------------
author: Gerrit Code Review
date: 2016-05-12 15:32:58.318000000

Change has been successfully cherry-picked as c7b6d4f96250a3afe417bb9bb4ed7abb33add31c by Natasha Sullivan

-------------------------------------
