20sec to open a bucket


#1

Hi All,

As I’m starting to learn couchbase and play with it I encounter very long delays when opening an existing bucket.
Reads and Writes are fast enough (~2ms/item when server near cluster and 55ms/item when running from localhost) so communication with the cluster works.
The cluster is located inside an Azure VPN. Servers are weak and idle (just for testing).
I’m using the latest community server and the latest .net API

Opening an existing bucket takes more than 20 sec, both from localhost and from near the cluster.
I’m using:
IBucket Bucket = Cluster.OpenBucket(sBucketName, sPassword)

Please advise as to why it consistently takes so much time.

Thanks.


#2

@itay -

Can you enable logging and post your logs? I just need to see what the bootstrapping process has logged…also, what does your configuration look like? Are you using the App.Config or programmatically providing configuration?

-Jeff


#3

Hi Jeff.
Thanks for your prompt response.

Configuration is pretty simple:

  var config = new ClientConfiguration
  {
    Servers = new List<Uri>
    {
      new Uri("http://mycbdbserver.cloudapp.net:8091/pools")
    }
  };
  Cluster = new Cluster(config);

Nothing specific is registered in the log (at least under the log tab in the console). There are past entries there though.

Itay


#4

@itay -

You can enable logging on the client by following these steps: http://docs.couchbase.com/developer/dotnet-2.0/setting-up-logging.html

Note: ignore the “do not use” warning on the Common.Logging.Log4Net package - the project changed it’s packaging and the Couchbase .NET Client hasn’t yet taken the new dependencies, but it will still work.

-Jeff


#5

There might be a type in the page you pointed to, especially in:

 <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n" />

around <%X{auth}>

Second, the screenshot from NuGet also changed with new versions.

After installing it, I get an exception:
"Failed obtaining configuration for Common.Logging from configuration section ‘common/logging’."
Another question is where are the logs located and which to send (I’m not a log4net fan)

Thanks


#6

@itay -

Yeah, the screenshot changed because Commons changed their packaging and it still needs to be updated. Here is an example log4net config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="common">
            <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
        </sectionGroup>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    </configSections>
<common>
     <logging>
        <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net">
        <arg key="configType" value="INLINE" />
        </factoryAdapter>
     </logging>
</common>
 <log4net>
    <appender name="FileAppender" type="log4net.Appender.FileAppender">
    <param name="File" value="C:\temp\log.txt" />
     <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %level %logger - %message%newline" />
    </layout>
    </appender>
    <root>
         <level value="DEBUG" />
         <appender-ref ref="FileAppender" />
    </root>
</log4net>
</configuration>

This will log to a file named log.txt in C:\temp.


#7

Thanks,
I’m still getting the same error. It might be related to the package I’m using. Am I using the correct one:

I cannot use the deprecated version as it depends on Common.Logging 2.0 while CouchBase is using 2.3.1


#8

@itay -

I cannot use the deprecated version as it depends on Common.Logging 2.0 while CouchBase is using 2.3.1

This shouldn’t matter - the NuGet dependency that is installed is Common.Logging 2.0…I just tried it and it works with the deprecated Common.Logging.Log4Net.

I created a Jira ticket and attached an example project: https://issues.couchbase.com/browse/NCBC-773

-Jeff


#9

It is an honor to have a ticket opened after me :innocent:

I really cannot install Common.Logging 2.0.
When trying to Uninstall ver 2.3.1 to make room for 2.0 I get this message:


#10

@itay -

Haha! Uninstall Couchbase SDK first, then re-install it and finally add the logging dependencies. Once you get that working, run one operation and attach the log file to the Jira ticket.

Thanks!

-Jeff


#11

I finally managed to run your consoleapplication1 (had to restore all the dependencies) !

Still 20 sec !
Read and write are fast.

Log file uploaded to JIRA. I hope it makes sense to someone :stuck_out_tongue_winking_eye:


#12

@jmorris

You are correct !!
I missed some ports on some of the servers and delay was reduced from 20sec to 1.5sec from localhost and 234ms from remote

Thanks