0

I have a 5 node Cassandra cluster set up on EC2, all in the same region.

If I connect over cqlsh (9160), queries respond in under a second.

When I connect via Dev Center, or using the native Java Driver, both of which use port 9042, the queries take over 20 seconds to respond.

They consistently respond in the same 21 second region. Never fast and then slow.

I have set up a few Cassandra Clusters on EC2 and have seen this before but do not know how to fix the problem. The last time, I scrapped the cluster and built a new one and the response time on port 9042 was fine.

Any help in how to debug or fix this problem would be appreciated, thanks.

felbus
  • 153
  • 7

1 Answers1

0

The current version of DevCenter was designed to support as main scenario running (longish) CQL scripts (vs an interactive console with queries executed one after another). DevCenter is using as an underlying connector the DataStax Java driver for Cassandra.

For the above mentioned scenario, in order to ensure there are no "conflicts", a new Session is created for each execution. When a Session is initialized, the driver performs an auto-node discovery, creates connection pools, etc. Basically it does a lot of preparation work. Depending on the latency from your client machine to the EC2 nodes, the size of the cluster and also the configuration of these nodes (see the connection requirements), this initialization phase can be quite expensive.

As you can imagine the time spent preparing wouldn't represent a large percentage of running a DDL script and a decent size of inserts/updates. But for an interactive scenario, it will result in a suboptimal behavior (the one you are describing)

The next version(s) of DevCenter will address the interactive scenario and optimize for it so the user experience would be what you'd expect. And supporting this scenario is pretty high on our list of priorities.

Taken From: https://stackoverflow.com/questions/21219300/cassandra-native-transport-port-9042-slow-on-ec2-machine/21224540#21224540

felbus
  • 153
  • 7