Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
2.0.1
-
None
-
Security Level: Public
Description
Customer evaluated Couchbase vs Redis
When they try to set and to observe to replica by
client.set(key, value, PersistTo.ZERO, ReplicateTo.ONE).get().
They got poor resultes of 10 ops
Regarding to Perry advise to split the set comand to set and observe
OperationFuture<Boolean> op = client.set(g.getCode(), mapper.writeValueAsString(g));
settimer.stop();
timer = validateMetric.time();
client.observePoll(g.getCode(), op.getCas(), PersistTo.ZERO, ReplicateTo.ONE, false);
timer.stop();
they stil got poor results of 600ms per operation when the while the pollInterval set to 100
With setting the obsPollInterval to 3 the results went down to 520 ms.
To evaluate the minimum times to verfy the set by this code :
boolean found = false;
int observeCounter = 0;
do {
Map<?, ObserveResponse> resp = client.observe(g.getCode(), op.getCas());
int i = 0;
for (ObserveResponse r : resp.values()) {
if (r == ObserveResponse.FOUND_NOT_PERSISTED || r == ObserveResponse.FOUND_PERSISTED)
}
if (i > 1)
else
{ Thread.sleep(1); } observeCounter++;
} while
It takes 200 observe calls in average to validate the replication. Without sleep(1) it takes 800 calls.
To evaluate the avarge time that it takes to observe by :
OperationFuture<Boolean> op = client.set(g.getCode(), mapper.writeValueAsString(g));
Thread.sleep(<<1ms-500ms>>);
Map<?, ObserveResponse> resp = client.observe(g.getCode(), op.getCas());
for (ObserveResponse r : resp.values()) {
if (r == ObserveResponse.FOUND_NOT_PERSISTED || r == ObserveResponse.FOUND_PERSISTED)
}
if (i > 1)
Each single set() test gives different results. Thread.sleep(500) is sometimes enough, but sometimes it’s not. 1000ms is mostly enough.
Attachments
Issue Links
- relates to
-
MB-8453 High latency when observe to replica
- Closed