0

I have an C# application (Datastax driver) which is focused on Casandra data retrieval. One of the major issues with this is that with increase in volume, the asynchronous reads take more than 60 seconds to respond and that leads to timeouts in the application. As this is a data retrieval request, so I have to wait on the asynchronous execute call to finish. This sometimes leads to loss in TCP socket connections in the application. Any suggestion to tackle this issue is greatly appreciated.

theduck
  • 2,589
  • 13
  • 17
  • 23
  • 4
    You've provided very little information for debugging. Have you tried tracing the query in cqlsh? What is the output of nodetool tablestats and tablehistograms for this table? What is the data model? A brief description of the work load would also be helpful. Well designed schemas on modern hardware should have single digit millisecond response times. – zznate Sep 26 '19 at 01:46
  • 2
    A code sample would help also – jorgebg Sep 26 '19 at 12:05
  • If you have a query that takes 60 seconds to respond there are some serious issues somewhere. Considering reads timeout in 5 or 10 seconds, I'm not even sure how that would happen (unless your nodes are completely overwhelmed and can't even respond to the Cassandra timeouts). – Jim Wartnick Sep 26 '19 at 15:33
  • most probably is that you're not using the read by partition key, but instead using `select * from table`, or `select ... from table where ... ALLOW FILTERING`... – Alex Ott Oct 01 '19 at 07:34
  • @AlexOtt Yes, I am using ALLOW FILTERING for all of my queries. Why do you think it is going to be a bottleneck? – Sitakant Mishra Oct 03 '19 at 23:07
  • So, I have seen that if there will be sudden increase in volume per say 1000 messages per minute, the cassandra retrieve request slows down up to 60 seconds or more. For some reason, it looks like the Datastax driver is loosing socket connections and my windows application throws the following error. Listen > Failed to open socket: System.Net.Sockets.SocketException (0x80004005): A blocking operation was interrupted by a call to WSACancelBlockingCall. – Sitakant Mishra Oct 03 '19 at 23:15
  • After this other services in the application does not get any socket connections. – Sitakant Mishra Oct 03 '19 at 23:16
  • You need to read more on how Cassandra works - it isn't designed to execute queries that run on multiple machines & fetch all data. I recommend to take DS201 & DS220 courses on https://academy.datastax.com/ – Alex Ott Oct 04 '19 at 09:02

1 Answers1

0

Cassandra use Log-structured_merge-tree which is optimized for write complicity not for the read

Read O(N) 
delete O(n) 
Write O(1)

So as data grow the read performance start impacting down

sandeep rawat
  • 4,797
  • 1
  • 18
  • 36