Datastax driver: We are running into a serious issue of holding up lot of connections. We have no clue where these connections are created.
I will first tell you about my context:
- We use datastax driver to connect to Cassandra.
- We just create one session for an app and use it for the app liefetime.
- We create keyspace to isolate each dev environment. So people can create keyspace when they require.
Frequently the Cassandra server goes down. When we looked at the issue when it is slow or down, the cluster seems to have lot of incoming connections from several dev environment.
Ideally our expectation is there should be 6-10 connections from a single dev environment. But we see a few thousands.
We see these kind of logs.
-- [com.datastax.driver.core.ControlConnection] (Cassandra Java Driver worker-6315) [Control connection] Connection error while refreshing schema Write attempt on defunct connection)
-- [com.datastax.driver.core.ControlConnection] (Cassandra Java Driver worker-6314) [Control connection] Refreshing schema for XXXX
We see lots of Cassandra Java Driver worker threads.
XXXX
is some random keyspace in the cluster.
Any idea to where the problem could be?