Check the current number of connections to MongoDb

前端 未结 12 1096
南方客
南方客 2020-12-12 14:27

What is the command to get the number of clients connected to a particular MongoDB server?

12条回答
  •  庸人自扰
    2020-12-12 15:10

    Connect to MongoDB using mongo-shell and run following command.

    db.serverStatus().connections
    

    e.g:

    mongo> db.serverStatus().connections
    { "current" : 3, "available" : 816, "totalCreated" : NumberLong(1270) }
    

提交回复
热议问题