Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-149

Delay in view requests when FindServicePoint is called

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.2 Beta-2
    • 1.2 Beta
    • None
    • None

    Description

      Problem reported with accessing the new view code: the very first request to a view takes about 6-7 seconds. This is not acceptable. I've discovered that majority of this time the client spends looking up for a proxy inside Hammock->GetResponse->HttpWebReques.FindServicePoint. I'm wonder if it is known issue and if there is workaround for it.

      The test code:

      using(var client = new CouchbaseClient("couchbase"))
      {
      var sw = new System.Diagnostics.Stopwatch();
      sw.Start();
      var rows = client.GetView("users", "UserById").Stale(StaleMode.AllowStale).Key(0);
      sw.Stop();
      Console.WriteLine("GetView: " + sw.ElapsedMilliseconds); //about 100ms here
      sw.Reset();
      sw.Start();
      var row = rows.FirstOrDefault(); //6-7 seconds here
      sw.Stop();
      Console.WriteLine("First Enumeration: " + sw.ElapsedMilliseconds);
      sw.Reset();
      sw.Start();
      for(int i = 1; i < 100; i++)

      { rows = client.GetView("users", "UserById").Stale(StaleMode.AllowStale).Key(i); row = rows.FirstOrDefault(); //5-7ms if(i % 10 == 0) Console.WriteLine(i); }

      sw.Stop();
      }
      Console.WriteLine(sw.ElapsedMilliseconds / 99.0);

      The config file:
      <?xml version="1.0" encoding="utf-8" ?>
      <configuration>
      <configSections>
      <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase, Version=1.2.0.0, Culture=neutral, PublicKeyToken=05e9c6b5a9ec94c2"/>
      </configSections>
      <couchbase>
      <servers bucket="loginservice">
      <add uri="http://127.0.0.1:8091/pools"/>
      </servers>
      </couchbase>
      </configuration>

      The view:
      function (doc, meta) {
      if (doc.U >= 0)
      {
      emit(doc.U,

      {C:doc.C,G: doc.G, A: doc.A}

      );
      }
      }

      Data sample:

      { "C": 127, "U": 1004214, "G": 100000000000004210, "A": true, "E": [] }

      Attachments

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

        Activity

          People

            john John Zablocki (Inactive)
            john John Zablocki (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty