From 5b50c7947a1f5f7caebc06302c1f9ddbc2e8bb05 Mon Sep 17 00:00:00 2001
From: Michael Nitschinger <michael@nitschinger.at>
Date: Thu, 28 Apr 2016 14:10:18 +0200
Subject: [PATCH] [couchbase2] Better default settings.

This changeset picks better default settings for the environment
to make it less error-prone in cloud setups and in turn leads to
easier usability.

The changes made are:

  - queryEndpoints set from 5 to 1 by default since this is technically
    a leftover from earlier implementations. We now have a Bucket per
    Thread and since YCSB is sync anyways we only ever need one. Leaving
    it as an option since if we get async ops in the future we can utilize
    those.

  - socketConnectTimeout from 1s to 10s, especially in cloud environments
    socket timeouts are annoying and its better if we have higher defaults.

  - connectTimeout changed from 5s to 30s since the socket connect timeout
    is higher we also need to adjust this one.

  - kvTimeout changed from 2.5s to 10s so that under throughput saturation
    testing you don't get flooded with timeouts potentially. Note that it
    also makes for nicer output if you get "higher latencies" as part of
    the regular output and not in the error section.
---
 .../java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
index cdd57d84..e89a3dff 100644
--- a/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
+++ b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
@@ -142,7 +142,7 @@ public class Couchbase2Client extends DB {
     kv = props.getProperty("couchbase.kv", "true").equals("true");
     maxParallelism = Integer.parseInt(props.getProperty("couchbase.maxParallelism", "1"));
     kvEndpoints = Integer.parseInt(props.getProperty("couchbase.kvEndpoints", "1"));
-    queryEndpoints = Integer.parseInt(props.getProperty("couchbase.queryEndpoints", "5"));
+    queryEndpoints = Integer.parseInt(props.getProperty("couchbase.queryEndpoints", "1"));
     epoll = props.getProperty("couchbase.epoll", "false").equals("true");
     boost = Integer.parseInt(props.getProperty("couchbase.boost", "3"));
     networkMetricsInterval = Integer.parseInt(props.getProperty("couchbase.networkMetricsInterval", "0"));
@@ -170,6 +170,9 @@ public class Couchbase2Client extends DB {
               .callbacksOnIoPool(true)
               .runtimeMetricsCollectorConfig(runtimeConfig)
               .networkLatencyMetricsCollectorConfig(latencyConfig)
+              .socketConnectTimeout(10000) // 10 secs socket connect timeout
+              .connectTimeout(30000) // 30 secs overall bucket open timeout
+              .kvTimeout(10000) // 10 instead of 2.5s for KV ops
               .kvEndpoints(kvEndpoints);
 
           // Tune boosting and epoll based on settings
-- 
GitLab