Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common mongodb operation and maintenance monitoring and implementation plans?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the common operation and maintenance monitoring and implementation plans of mongodb". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the common operation and maintenance monitoring and implementation plans of mongodb"?

Query slow requests for more than 3 seconds. Test library needs to be replaced with a specific db name.

Db.currentOp (

{

"active": true

"secs_running": {"$gt": 3}

"ns": / ^ test\. /

}

)

Query all write operations waiting for a lock

Db.currentOp (

{

"waitingForLock": true

$or: [

{"op": {"$in": ["insert", "update", "remove"]}}

{"query.findandmodify": {$exists: true}}

]

}

)

Batch kill slow query

Db.currentOp (

{

"active": true

"microsecs_running": {"$gt": 100}

"ns": / ^ test2\. /

}. Inprog.forEach (

Function (op)

{

Db.killOp (op.opid)

Printjson (op)

}

)

Query requests exceeding 0.1s

Db.currentOp ({secs_running: {$gte: 0.1}})

At this point, I believe you have a deeper understanding of "what are the common operation and maintenance monitoring and implementation plans of mongodb". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report