Document Database Service

Methods to Locate Slow Requests

2025-07-16 07:18:47

Methods to locate slow requests in the DDS and solutions:

1. Each instance has its corresponding details. You can switch to the Slow Query Log label in the details to locate which statements generate slow requests during use.

2. Use the explain() method to check the SQL execution plan in the slow query log.

Connecting to the related DDS:

db.collection.find({"field": "value" }).explain("executionStats")

3. General solutions to slow requests:

  1. Creating an appropriate index: Based on the result of the execution plan, if you find that a query does not use an index or uses an inappropriate index, you can create an appropriate index based on the field to query and the access mode.

  2. Optimizing query criteria: Check the query criteria for slow queries to ensure that the appropriate query operators and index keys are used. Avoid a full table scan and unnecessary data loading.

  3. Monitoring system resources: On Dashboard, check whether monitoring metrics are abnormal when slow requests are executed. Slow queries may be related to system resources, such as CPU usage, memory usage, and disk I/O. Use the Dashboard function to check the usage of system resources and check whether resource bottlenecks exist.

  4. Optimizing hardware and network configurations: Ensure that MongoDB is running on well-performing hardware and that the network connection is stable. The optimization of hardware and network configurations can improve the overall performance.


oEAw0QbPLZLH