Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-8453

High latency when observe to replica

    XMLWordPrintable

Details

    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)

      { i++; }

      }
      if (i > 1)

      { found = true; }

      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)

      { i++; }

      }
      if (i > 1)

      { found = true; }

      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              abhinav Abhi Dangeti
              ilan Ilan Katz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty