[JCBC-212] Add new throttling feature to allow us to keep from using all system memory Created: 15/Jan/13  Updated: 18/Jan/13  Resolved: 18/Jan/13

Status: Resolved
Project: Couchbase Java Client
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.1
Security Level: Public

Type: New Feature Priority: Major
Reporter: Matt Ingenthron Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

When doing things like bulk loading, there are times we have multiple workload profiles. Interactive applications using the same client and same server need "room to move" and should always be fast, while other workloads should throttle themselves.

The intent here would be to add a feature such that:
for every N operations, pull stats from the nodes
if the amount of memory used is below high_wat, don't do anything
else if the amount of memory used is 10% of the remaining memory above high_wat before max memory usage, insert a sleep of Y milliseconds before each operation, and log the backoff at a debug level, check stats again ever M operations
else if the amount of memory used is greater than 10% above that level above high_wat, insert a sleep of Z milliseconds before each operation and log the backoff at an info level, check stats again every O operations
Turning this on or off should be done via a properties file or just simple -D args to the JVM, either one is okay.

N, M, O and Y, Z should all be tuneable, either via a properties file or a define. All of them should be optional.

Default values should be:
N = 10000
M = N/100
O = M/10

Y = 1ms
Z = Y * 3

Comment by Michael Nitschinger [ 17/Jan/13 ]
Generated at Sun Oct 26 03:58:38 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.