Upgrading from sdk 2.7.x to 3.0.x or 3.1.x degrades performance significantly

Not sure what I’m doing wrong, but the performance of the .net SDK has reduced significantly… Using .net SDK 2.7.x was incredibly faster… I simplified the test to just this…

using System;
using System.Diagnostics;
using System.Threading.Tasks;

namespace CouchbaseTest
{
class Program
{
static async Task Main(string args)
{
var stopWatch = Stopwatch.StartNew();
var cluster = await Couchbase.Cluster.ConnectAsync(“ip address”, “user”, “pwd”).ConfigureAwait(false);
var bucket = await cluster.BucketAsync(“bucketname”).ConfigureAwait(false);
var ping = bucket.PingAsync().ConfigureAwait(false);
stopWatch.Stop();
Console.WriteLine($"{stopWatch.ElapsedMilliseconds} ms");
}
}
}

The code works (with proper ip address, username and password) and returns in about 36 seconds (testing against remote server) with 3.x sdk. With 2.7 sdk it returns in about 3 seconds… using the following code:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using Couchbase;
using Couchbase.Configuration.Client;

namespace CouchbaseTest
{
class Program
{
static void Main(string args)
{
var clientConfig = new ClientConfiguration
{
Servers = new List { new Uri(“http://ip address:8091”) }
};

        var stopWatch = Stopwatch.StartNew();
        var cluster = new Cluster(clientConfig);
        cluster.Authenticate("user", "pswd");
        var bucket = cluster.OpenBucket("bucket name");
        bucket.Ping();
        stopWatch.Stop();
        Console.WriteLine($"{stopWatch.ElapsedMilliseconds} ms");
    }
}

}

I’m using the same IP address, user name, password, and bucket name (obscured here for obvious reasons).

Hello @mmyers thanks for reaching out.

I tried against a cluster running on AWS (granted my side of internet is slow) still everytime I ran the code it got me back in about 5 seconds or less

Can you tell us more about the environment

Which Couchbase Server Version are you testing against ? I was running 6.6 CE
Which particular .net SDK 3.x version are you using ? I was using 3.1.7
What is your OS ? Mine is Mac OS

@mmyers -

Additionally, I suspect something is timing out causing the delay - enabling logging will help isolate the issue.

Jeff

Server: Community Edition 6.0.0 build 1693
Tried .net sdk versions: 3.0.5, 3.0.7, 3.1.7
Client is running on: Windows 10 Enterprise build 19043.1052
Server is running on: Linux 4.14.104+ in Google container

Thank you so much for the tip about logging… It showed:

info: Couchbase.DnsClientDnsResolver[0]
There was an error attempting to resolve hosts using DNS-SRV - Non-Existent Domain

This causes the extra 30 seconds of wait time. For any others that experience this, I resolved by setting:

EnableDnsSrvResolution = false

in the options.

1 Like