DESCRIPTION

JVMCBC-335: Allow customization of RingBuffer waiting strategy.

Motivation
----------
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.

Modifications
-------------
Added a property of type WaitStrategy to CoreEnvironment

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

Change-Id: I1558fbab2ad5c0c46785de67920a715dc48e50eb


COMMENTS

author: Gianna Garza
date: 2016-05-11 08:50:59.404000000

Uploaded patch set 2: Commit message was updated.

-------------------------------------
author: Gianna Garza
date: 2016-05-11 09:27:14.971000000

Patch Set 2:

I have updated java-client http://review.couchbase.org/#/c/63925/

-------------------------------------
author: Natasha Sullivan
date: 2016-05-12 06:53:59.579000000

Patch Set 2: Code-Review-1

(6 comments)

Thanks very much, I have a few more requests.. once they are done I'd love to merge it - its a great timing since 2.3.0 / 1.3.0 is around the corner!

Line:419, src/main/java/com/couchbase/client/core/env/CoreEnvironment.java -> please rename to requestBufferWaitStrategy() for consistency :)

Line:703, src/main/java/com/couchbase/client/core/env/DefaultCoreEnvironment.java -> requestBufferWaitStrategy

Line:751, src/main/java/com/couchbase/client/core/env/DefaultCoreEnvironment.java -> please set it to null (check right below for similar example). and then in the constructor where the builder is used check if (null) and if so apply the blocking one :)

Line:1232, src/main/java/com/couchbase/client/core/env/DefaultCoreEnvironment.java -> requestBufferWaitStrategy

Line:1295, src/main/java/com/couchbase/client/core/env/DefaultCoreEnvironment.java -> requestBufferWaitStrategy

Line:156, src/main/java/com/couchbase/client/core/CouchbaseCore.java -> please don't do it on the response Disruptor, just on the requestDisruptor

-------------------------------------
author: Natasha Sullivan
date: 2016-05-12 06:54:58.216000000

Patch Set 2:

(1 comment)

Line:11, /COMMIT_MSG -> please limit to 60-70 chars around :)

-------------------------------------
author: Gianna Garza
date: 2016-05-12 07:28:50.042000000

Patch Set 2:

(1 comment)

Line:156, src/main/java/com/couchbase/client/core/CouchbaseCore.java -> and why is that?

-------------------------------------
author: Natasha Sullivan
date: 2016-05-12 07:32:02.627000000

Patch Set 2:

(1 comment)

Line:156, src/main/java/com/couchbase/client/core/CouchbaseCore.java -> oh sorry forgot to explain :)

The response disruptor does not handle the good response traffic in recent versions, the IO thread directly schedules it on the computation pool. Only not my vbucket and other retry scenarios are scheduled here.

The downside of doing it on both is that lets say you use a high frequency wakeup strategy its totally unnecessary since the response handler will wakeup very often and make it worse than better I think.

-------------------------------------
author: Gianna Garza
date: 2016-05-12 09:49:43.937000000

Patch Set 2:

(1 comment)

Line:156, src/main/java/com/couchbase/client/core/CouchbaseCore.java -> I will test that and let you know about the results.

-------------------------------------
author: Gianna Garza
date: 2016-05-12 13:15:26.908000000

Patch Set 2:

CPU usage is lower when only request disputor has changed wait starategy.
Response times are the same.

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

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

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