SequoiaDB giant sequoia database-client connections

  • The number of client connections reflects the number of connections established between the application system and the cluster. You can use the following command to view:

    sdb -f getCoordConn.js

    Copy

  • The content of getCoordConn.js is as follows:

    var db = new Sdb();
    var nodes = db.list(7,{GroupName:"SYSCoord"},{"Group.HostName":1,"Group.Service.Name":1}).next().toObj()["Group"];
    var sum = 0;
    for(var i in nodes){
    var node = nodes[i];
    sum += new Sdb(node["HostName"],node["Service"][0]["Name"]).snapshot(6,{},{"TotalNumConnects":1}).next().toObj()["TotalNumConnects"];
    }
    println("集群客户端连接数:"+sum);

    Copy

Connections consume file handles and memory resources, and excessive concurrency can also cause frequent thread context switching. If the index is higher than the expected value, it indicates that the amount of user requests exceeds the ability of the database to process requests; when the data node pressure is not great, you can increase the coordination node to increase the amount of concurrency, otherwise the cluster needs to be expanded.

The creation of database connections is a time-consuming operation. Applications are frequently created and destroyed. Unclosed connections may also lead to excessive connections. It is recommended to use the database connection pool in the driver for connection management. The connection pool allows the application to use it more effectively. Connect with reuse.

For more information, please visit the official website of Jushan Database

Guess you like

Origin blog.csdn.net/weixin_48909806/article/details/112907410