Couchbase is taking too long in the first response


#1

Hi,

We have Couchbase running over a CentOS server and we have another server running Windows with the applications (Written in .NET). Everything is Ok, but the first response takes about 15-30 seconds. The rest of the calls are fast enough (depends the amount of data)

That’s not a big deal because is the first call, but if nobody make a request against that server in 20-30 minutes, the next request take again about 15-30 seconds. Any Idea about which could be the problem?

Also, I would like to ask if you could say me recommendations for good material for improve the performance in couchbase (Video, blogs, books…)


#2

Hi,

What version of the .net SDK are you using? Also, can you send an example of your bucket connection code (passwords removed)?

Thanks

Todd


#3

Hi

The version of the .NET sdk is 2.1.3

Here is the connection code

var cluster = new Cluster(new ClientConfiguration
{
	Servers = new List<Uri>
		{
			new Uri("url")
		}
});

using (var bucket = cluster.OpenBucket("user", "pass"))
{
 try
 {
	var documentList = bucket.Get<T>(docsId);

	
	return documentList.Select(doc => doc.Value.Value as ICouchbaseObject).ToList();
 }
 catch (Exception ex)
 {
	Log.Error("Error retrieving documents from couchbase: "+ ex);
 }
}

#4

Sounds like the initial connection is taking a long time. Are you using a hostname or IP address for the cluster node(s) in your Server list?

If you are using hostnames, can you check that the cluster node name(s) you’re providing to your application resolve correctly (and quickly) from the application server? On Linux I’d use host <hostname> to look it up, but I don’t know if there’s the same on Windows…

One way to quickly check this would be to temporarily change to IP addresses in the Server list and see if the speed problem resolves itself…