Search code examples
cassandradatastaxdatastax-enterprise

Datastax DotNet Driver(2.7.0.0) connection to cluster experiencing delays or appears slow


I am using two nodes in same network in india, application(front-end dotnet driver) hosted in US. Now when i connect US to India server it takes 4 to 5 second to connect.

  • I am Using Public IP for Connecting from dotnet driver(US) to Node(India)
  • Private IP is used Inside node configuration.
  • Datastax version is DSE 4.7.3.
  • Node O/S is CentOS
  • Ping time between Node(india) and application(US) is fine.

My Main problem is It takes 4 sec to connect nodes(create session), so I can not improve the performance by using cassandra. Kindly help me from this problem.


Solution

  • A time-to-establish of 3-5 seconds is perfectly normal. Your problem is related to the application architecture. What you probably are doing is opening a new session on every request, which is not the way to go.

    Instead, establish a connection to the cluster once and use the returned session in a singleton lifestyle, e.g. using a preferred IoC

    Then use the same session over and over for every new request.