High CPU Utilization
Last updated: 2020-02-25 18:09:34PDF
If you find the CPU utilization is high when using MongoDB, you can troubleshoot the problem as follows.
Check if your database operation is too frequently.
You can check the monitoring metrics on the console, as shown below. If the QPS is high, you may evaluate whether the instance needs to be upgraded. If the QPS is not high, check if there is any slow log.
Check if there is a slow log on MongoDB.
Log in to the Console of TencentDB for MongoDB , and view the slow log of the instance by using "Query statistics", as shown below.
Please pay attention to keywords such as command, COLLSCAN, IXSCAN, keysExamined and docsExamined.
- Command indicates the operations recorded in a slow log.
- COLLSCAN indicates a full table scan is performed. IXSCAN indicates an index scan is performed. For more information, please see MongoDB official website .
- KeysExamined the number of index entries scanned. DocsExamined indicates the number of documents scanned. Larger keysExamined and docsExamined values mean that no index is created or the index is less distinctive. Please confirm the fields for which an index is created.
For more log descriptions, please see MongoDB official website .