-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting "gocql no hosts available in the pool" when we are continuously streaming data #1806
Comments
The above comment asking you to download a file is malware to steal your account; do not under any circumstances download or run it. The post needs to be removed. If you have attempted to run it please have your system cleaned and your account secured immediately. |
@caineblood which file are you referring to?
|
@sathyendranv, I was able to simulate the case you reported. I ran multiple iterations using the GoCQL client configuration you provided, and everything worked fine—no errors were generated by the GoCQL driver when using the same setup of 4-6 streams. However, I did manage to reproduce the exact error you mentioned ("gocql no hosts available in the pool" and "no response received from cassandra within timeout period"), but only when there were 5000 concurrent streams. This leads me to believe that the issue is not with the driver itself but more likely related to resource limitations within your environment. Running a single-node Cassandra cluster in a Docker container can lead to performance degradation under heavy loads. Docker introduces additional overhead, and Cassandra’s single-node setup may cause significant stress on the system when handling large write requests. The setup with 120 data points (approx. 100 mb) per second results in significant CPU and memory usage, which can lead to slow processing of write requests and timeouts. This load is substantial and could easily overwhelm 1 node, especially when running in a Docker environment with limited resources. Disk I/O saturation is another likely cause. Cassandra's write-intensive workload involves commit log writes, memtable flushes, and SSTable compactions, all of which heavily utilize disk resources. If the disk cannot keep up with these operations, it will result in increased write latency and timeouts in the client application. High disk I/O from continuous writes can significantly degrade performance. With limited resources, Cassandra may take longer to process requests, causing gocql’s connection pool to be depleted, as connections remain occupied for longer periods and pool may get exhausted. This results in Cassandra slowing down and eventually failing to keep up with the incoming data load. I have developed a program that mimics this case, which can be used to further troubleshooting.
Default Setup: The program operates with 5 streams, each writing 25 data points per second, resulting in a total of 125 writes per second over a duration of 10 minutes. But you can tune it as you wish. Tell me, if the program is accurate (or near to accuare) and you are able to reproduce the issue. General Recommendations.
Feel free to reach out if you need further help or specific adjustments. If you managed to recreate the errors but not with the extreme edge cases I used (like 5000 streams), let me know 😄 |
Please answer these questions before submitting your issue. Thanks!
What version of Cassandra are you using?
4.1.5
What version of Gocql are you using?
1.6.0
What version of Go are you using?
1.22
What did you do?
We are streaming data meta data (json as string) and blob data (blob) to cassandra db. It will do a continuous write. Per second there will around 20~30 data points with multiple streams. It might have up to 4 ~ 6 streams which will be around 120 datapoints per seconds.
Size of meta data will be around 200kb and blob will be ~500kb. Also its a single node Cassandra db running in container.
What did you expect to see?
All the write to be successfully.
What did you see instead?
Initially all the writes are successful and after few mins writes are failing with
gocql no response received from cassandra within timeout period and followed by
gocql no hosts available in the pool
If you are having connectivity related issues please share the following additional information
Describe your Cassandra cluster
Singe Node Cluster running in docker container
System setting
12th Gen Intel(R) Core(TM) i9-12900TE
Thread(s) per core: 2
Core(s) per socket: 16
RAM: 64 GB
Storage: SSD 1TB
Code Snippet
initialization:
write code. It will be called in multiple go routine when streaming data recvd.
nodetool status
SELECT peer, rpc_address FROM system.peers
gocql_debug
tag and post the outputThe text was updated successfully, but these errors were encountered: