What is recommended for cassandra max connections per host? How is it calculated? - cassandra

Is there a way to limit number of connections per host in cassandra cluster and based on what parameter this is calculated?
In some of cassandra node i can see established connections count for 9042 goes up to 1400+, is this something i need to worry about?
Thanks

Yes, you can limit the number of connections per host in the Cassandra cluster.
If you are using the C++ driver, check this out.
I visualize any query following the below path:
Client --> Session --> IO threads --> Connections --> Nodes
You can configure the number of IO threads(This is the number of threads that will handle query requests) associated with the session. In each IO thread, you can then configure the number of connections per host. If needed, the number of connections per host will increase based on certain parameters(The maximum count up to which this can be increased is also configurable).
So, at max, there can be x number of connections per host where,
x = number_of_sessions * number_of_IO_threads * max_number_of_connections_per_host
All 3 variables on RHS in the above equation are configurable.
Also check out:
https://www.datastax.com/dev/blog/4-simple-rules-when-using-the-datastax-drivers-for-cassandra
https://stackoverflow.com/a/28219086/5701173

Related

"An Azure Application Gateway instance can support around 10 Capacity Units" - Explanation in simple word

I've red the documentation and searched the internet for a simple explanation on Azure application gateway auto-scaling and the above quoted line but failed.
It would be really helpful if you can explain/provide a explanation link related to the same for better understanding.
Thank you!
When you enable auto scaling you need to set a minimum and maximum instance count. How do you know how many instances you need to handle the minimum amount of traffic you want to be able to handle? That is where Capacity Units play a role:
Capacity Unit is the measure of capacity utilization for an Application Gateway across multiple parameters.
A single Capacity Unit consists of the following parameters:
2500 Persistent connections
2.22-Mbps throughput
1 Compute Unit
If any one of these parameters are exceeded, then another n capacity unit(s) are necessary, even if the other two parameters don’t exceed this single capacity unit’s limits. The parameter with the highest utilization among the three above will be internally used for calculating capacity units, which is in turn billed.
When configuring the minimum and maximum number of instances you can now calculate how many instances you need because a single instance can handle up to 10 Capacity Units, so for example a maximum number of 10 * 2500 = 25.000 persistent connections.
For example: if you expect to have to deal with 6000 persistent connections you will need at least 3 instances (3 * 2500 = up to 7500 persistent connections)

Number of connections exceeding instance count * maxpool

We host a website on Microsoft Azure and we have Traffic Manager distributing traffic on two AppServices each with 15 instances and a maxpool size of 80 in the connection strings.
We also use P11 database which has a max connection count of 2400
From our understanding, the maximum possible connections would be:
Instance count * maxpool
30 * 80 = 2400
But we get errors regarding exceeding the maximum allowed number and to our surprise, running a query on the database to show us active connections yields 2600.
We don't have any webjobs running.
Can someone please explain what is happening?
Using the following query you can identity which program name have the most sessions, which login name creates the most sessions, which host creates the most sessions.
SELECT
c.session_id, c.net_transport, c.encrypt_option,
c.auth_scheme, s.host_name, s.program_name,
s.client_interface_name, s.login_name, s.nt_domain,
s.nt_user_name, s.original_login_name, c.connect_time,
s.login_time
FROM sys.dm_exec_connections AS c
JOIN sys.dm_exec_sessions AS s
ON c.session_id = s.session_id
The following statement shows you the maximum number of connections for the current tier.
SELECT ##MAX_CONNECTIONS AS 'Max Connections';
Hope this helps.
Regards,
Alberto Morillo

how to check how many pooled connection we have at a specific time in MemSQL

How can i tell that i have reached the maximum number of queries that my cluster can handle at a time?
If the connection pool size is too small for the workload then we have to adjust the max_pooled_connections configuration variable, which controls the number of pooled connections between each pair of nodes.
However how can I tell how many pooled connections we have at a specific time ?
In memsql agregator status i can see following entries Aborted_connects is 11 - why do we abort those connection ? Also Max_used_connections is 41, while Connections is a number that increases constantly.
How can i tell that i have reached the maximum number of queries that
my cluster can handle at a time?
There isn't a hard limit on the number of queries you can send other than max_connections (100k), but at some point the cluster will not execute them all at once and will schedule/queue them up. Is your question about the former or the latter?
If the connection pool size is too small for the workload then we have
to adjust the max_pooled_connections configuration variable, which
controls the number of pooled connections between each pair of nodes.
However how can I tell how many pooled connections we have at a
specific time ?
show leaves will show how many connections are currently open from the current node to each leaf. So the current connection pool size is min(current open connections, max_pooled_connections). Note that this is per (node, node) pair.
In memsql agregator status i can see following entries
Aborted_connects is 11 - why do we abort those connection ? Also
Max_used_connections is 41, while Connections is a number that
increases constantly.
Aborted connects includes e.g. failed login authentications.
max_used_connections is max peak, connections is cumulative total.

Optimized value for CICS MXT and DB2CONN TCBLIMIT

CICS DB2CONN has two limit value, TCBLIMIT and THREADLIMIT, is this true that these two value should be greater than the CICS MXT (max task) value?
No its not true that these two values should exceed MXT.
TCBLIMIT controls the maximum number of L8 TCBs that can concurrently establish a connection to DB2. As MXT controls the maximum number of user tasks in the CICS region at any one time you're not going to see more than MXT task wanting to connect to DB2. This results in DB2 waits. Interestingly, as DB2 threads use L8 TCBs so the MAXOPENTCBS SIT parameter also has an affect on the total number of tasks that can use DB2 concurrently.
THREADLIMIT on the other hand controls the number of threads active in the POOL or per DB2ENTRY. This is often mis-configured such that the total number defined exceeds TCBLIMIT
When defining the TCBLIMIT you should take a holistic view at the DB2 level. You'll need to understand the DB2 CTHREAD limit and then determine the concurrency requirements across all address spaces that are using the DB2. If you don't, and you set TCBLIMIT too high, you'll hit the DB2 CTHREAD limit which will result in delays.
There is an IBM red paper on CICS, DB2 and thread safety that provides guidance on this subject: http://www.redbooks.ibm.com/abstracts/redp4860.html?Open
Please feel free to come back to me if you have any further questions.

Increase MongoDB maximum number of connections

I am getting some errors on MongoDB side, the error is complaining that it reached the max allowed connections.
Wondering if there is anyway to increase the max number of allowed connections.
Check the MongoDB documentation:
http://www.mongodb.org/
use this command line argument:
--maxConns arg max number of simultaneous connections
You might want to check this: http://blog.boxedice.com/2011/06/08/mongodb-connection-overhead/

Resources