Max YCQL connections in YugabyteDB - yugabytedb

[Question posted by a user on YugabyteDB Community Slack]
What is the parameter that controls the maximum number of connections per tserver for ycql? I am looking at the equivalent of --ysql_max_connections which is having a default of 300. Is it applicable for YCQL also?

There is no way to limit connections on YCQL on the server-side.
But YCQL connections are multi-plexed, therefore you don't need many.
Are you sure you have 300 ycql connections on the server?
If yes, how many client-apps processes & servers are you starting and in what language? You may need at most 2-4 connections for each client-process. Some docs on configuring connections on the client side: https://support.yugabyte.com/hc/en-us/articles/4417928616845-How-to-configure-max-connections-in-YCQL-and-YSQL.

Related

How to track data movement in YugabyteDB in multi-region replication

[Question posted by a user on YugabyteDB Community Slack]
When I'm changing my placement info by adding a new datacenter, my data should start moving to accomplish my "rules". How can I track that movement?
get_load_move_completion This should give me some info?
get_load_move_completion command in yb-admin only tracks load movement when a node is decommissioned (blacklisted). Essentially, it returns 1 - (count of total replicas still present on the blacklisted nodes) / (total initial replica count on the blacklisted nodes) as a percentage.
The http://<yb-master-ip>:7000/tasks endpoint in the master admin UI is where you would be able to see all the adds and removals.

cassandra connections spikes load issue

I am using cassandra according to the following struct:
21 nodes , AWS EC2 i3.2xlarge , version 3.11.4 .
The application is opening about 5000 connection per node (so its 100k connections per cluster) using the datastax java connection driver.
Application is using autoscale and frequently opens/close connections.
Number of connections to open at once by app servers can reach up to 500 per node (opens simultaneously on all nodes at once - so its 10k connections opens at the same time across the cluster)
This cause spikes of load on cassandra and cause reads and writes latency.
I have noticed each time connections opens/close there are high number of reads from system_auth.roles and system_auth.role_permissions.
How can I prevent the load and resolve this issue ?
You need to modify your application to work with as small number of connections as possible. You need to have following in mind:
Create Cluster/Session object, once at start and keep it. Initialization of session is very expensive operation, it adds a load to Cassandra, and to your application as well
you may increase the number of the simultaneous requests per connection, instead of opening new connections. Protocol allows to have up to 32k requests per connection. Although, if you have too many requests in-flight, then it's a sign that your Cassandra doesn't keep with workload and can't answer fast enough. See documentation on connection pooling

Connection pooling in cassandra

In Mongo and HBase, we have a way to track the client connection, Is there a way to get the total client connection in Cassandra?
On client-side Datastax driver reports metrics on connections, task queues, queries and errors (connection errors, r/w timeouts, retries, speculative executions).
Can be accessed via the Cluster.getMetrics() operation (java).
Datastax provides a cassandra structure, CassMetrics (cpp driver). This structure contains min and max microseconds to execute a query, pending requests, timed-out requests, total connections and available connections. It gives the entire performance metrics of a particular snapshot of the session.
Each member of the structure is explained clearly in the following datastax documentation- https://docs.datastax.com/en/developer/cpp-driver/2.3/api/struct.CassMetrics/
Here, is an example program on how to use the structure effectively - https://github.com/datastax/cpp-driver/blob/master/examples/perf/perf.c

Azure Redis Cache - how connections are calculated

Can somebody explains how the connections are calculated in Azure Redis Cache?
For example if I have an MVC app and I use a Basic Redis Cache with 256 connections, and I have 256 users accessing my websites will there be 256 connections made? How exactly does this work?
How many connections are made depends on the application you implement.
If you follow best practices, your application will be able to handle many users with a very low amount of connections.
E.g. Stackexchange.Redis should be able to handle thousands of users without exhausting your 256 connections if you reuse the connection multiplexer object.
Some more information:
https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f
https://stackexchange.github.io/StackExchange.Redis/Basics
the key idea in StackExchange.Redis is that it aggressively shares the connection between concurrent callers

Cassandra Datastax Driver Tuning - more connections or more requests per connection?

I'm trying to tune Cassandra because I keep getting this error:
com.datastax.driver.core.exceptions.OperationTimedOutException: Timed out waiting for server response
But I'm not sure whether I should increase the number of connections I have per host or increase the number of requests per connection in the datastax driver.
In general, what is the best way to determine if adding more connections is better or adding more requests per connection?

Resources