Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not a Problem
    • Affects versions: None
    • Fix versions: None
    • Components: None
    • Labels:
      None
    • Sprint:

      Description

      We've been experiencing a very slow connect to cluster from c# driver. Like 10 seconds. And it's only happening when using c# driver - DevCenter and python driver are able to connect withing couple of milliseconds.

      Interesting that specifying 100 msec as connect timeout drastically decreases connection time, but specifying less resulting in timeout.

      WriteLine("[{0:G}] Start. Using cassandra c# driver version {1}",
                  DateTime.Now,
                  typeof(Cluster).Assembly.GetName().Version);
      
      using (var cluster = Cluster.Builder()
                                  .AddContactPoints("192.168.16.38", "192.168.16.40", "192.168.16.43")
                                  .WithCredentials("test", "test")
                                  // .WithSocketOptions(new SocketOptions().SetConnectTimeoutMillis(100)) - with this option it connects fast
                                  .Build())
      {
          WriteLine("[{0:G}] Cluster built", DateTime.Now);
      
          using (var session = cluster.Connect("system"))
          {
              WriteLine("[{0:G}] Connected", DateTime.Now);
      
              var rows = session.Execute("select * from local").GetRows().ToList();
              WriteLine("[{0:G}] Selected {1} rows", DateTime.Now, rows.Count);
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Michael Logutov Michael Logutov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: