Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

How do you monitor a MongoDB database to verify its status during major database operations?

I will soon need to perform some operations on our (azure-deployed) production database:

  • 2 large MongoRestore operations
  • 2 index rebuilds
  • 2 collection counts

I need to ensure that these operations will not crash our servers by using up too many resources. I currently don't know how "resource-hungry" my operations are/will be, and how much load they will generate. I want to know how likely they are to crash the database.

My plan is to first execute these operations in our development environment and monitor the resulting load to get an idea of the "strain" that these operations will create.

I basically have two questions:

  • What tool(s) is/are best for monitoring the job? Specifically for monitoring the state/health of the database as these operations are running on it, to get an idea of how "safe" the operations are. I currently have a paid "Core" version of Studio 3T. I also have the free version of Mongo Compass.

  • What metrics should I be watching for? I'm new to this- so I assume I have watch RAM/CPU usage to make sure it doesn't go above a certain threshold. How do I know "how high is too high"? What else should I look for?

question from:https://stackoverflow.com/questions/65873706/how-do-you-monitor-a-mongodb-database-to-verify-its-status-during-major-database

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. Monitor the RAM , CPU , IOPS , storage usage from the infrastructure.
  2. mongotop and mongostat give some general usage idea.
  3. Monitor the mongod/mongos logs ( the most valuable information is there )
  4. --noIndexRestore (add this to avoid your members to be blocked for index re-creation immediately after the load , you will create the indexes later in background )
  5. --numInsertionWorkersPerCollection=num1 , bigger num1 faster restore(more resource usage)
  6. --numParallelCollections=num2(default=4) , bigger num2 faster restore(more resource usage)
  7. --writeConcern="{w:'majority'}" ( keep it for safety , reducing it will improv significantly load speed )

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...