TencentDB for MongoDB

TencentDB for MongoDB
Troubleshooting
Product Documentation©2013-2022 Tencent Cloud. All rights reserved.

Page 1 of 7

TencentDB for MongoDB

Copyright Notice©2013-2024 Tencent Cloud. All rights reserved.
Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distributein any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.
Trademark Notice

All trademarks associated with Tencent Cloud and its services are owned by Tencent Cloud Computing (Beijing)
Company Limited and its affiliated companies. Trademarks of third parties referred to in this document are owned bytheir respective proprietors.
Service Statement
This document is intended to provide users with general information about Tencent Cloud's products and services
only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services aresubject to change. Specific products and services and the standards applicable to them are exclusively provided for inTencent Cloud's applicable terms and conditions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 2 of 7

TencentDB for MongoDB

Contents
Troubleshooting
Increased Slow Queries
Number of Connections Exceeding Limit©2013-2022 Tencent Cloud. All rights reserved.

Page 3 of 7

TencentDB for MongoDB

Troubleshooting
Increased Slow Queries：

Last updated 2024-01-15 14:49:55

Error Description
Slow query is the most common performance problem of MongoDB. You can use the slow query management andslow log query features in the console for troubleshooting.

Cause
The query is performed with the $lookup operator but doesn't use indexes or uses indexes that don't support thequery; therefore, it is necessary to traverse the entire database for a complete scan, which eventually leads to a very
low search efficiency.
Some documents in your collection have many large array fields that are time-consuming to search and index, causing
a high system load.

Troubleshooting Procedure
Log in to the TencentDB for MongoDB console and click an instance ID to enter the instance management page.
Method 1: select Database Management > Slow Query Management, and the list will display the requests being
executed by the current instance (including requests of secondary nodes). You can click Batch Kill to kill slow querystatements.

Method 2: select the Slow Log Query tab to view and analyze slow logs. The system logs operations executed formore than 100 milliseconds and retains slow logs for 7 days. Currently, slow logs cannot be exported. If needed,
contact the aftersales service or submit a ticket for assistance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 4 of 7

TencentDB for MongoDB

If slow queries are heaping too fast, you are recommended to optimize your business based on the slow query
analysis result. If the problem persists, contact the aftersales service or submit a ticket for assistance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 5 of 7

TencentDB for MongoDB

Number of Connections Exceeding Limit：

Last updated 2024-01-15 14:49:56

Issue Description
If the number of connections exceeds the upper limit, you can use the connection management and restart features in
the console and optimize the service for troubleshooting.

Cause
There are connection leaks, improper client coding, unreasonable connection pool configuration, or many unreleasedconnections.
There is a large number of concurrent application requests, and the configured upper limit of connections isinsufficient, so the current database specification cannot sustain such requests.

Troubleshooting Procedure
Option 1. Increase the upper limit
1. Log in to the TencentDB for MongoDB console and click an instance ID to enter the instance management page.
2. Select Database Management > Manage Connection and view the source IPs and number of connections forservice troubleshooting.
Note:
If the number of connections reaches or exceeds 80% of the upper limit and affects the establishment of newconnections, you can click Increase Connections in the console to increase the maximum number of connections to150% of the original limit for the next 6 hours.
If the problem persists, contact the aftersales service or submit a ticket for assistance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 6 of 7

TencentDB for MongoDB

Option 2. Restart the instance
1. Log in to the TencentDB for MongoDB console and click an instance ID to enter the instance management page.
2. Select Database Management > Manage Connection. You can click Restart on the right to restart the mongos
instance to fix the problem.
Note:
Replica sets on v4.0 don't have mongos instances.
Restarting the mongod instance is highly risky and will cause a momentary disconnection, during which if data iswritten, rollback may be triggered, leading to data loss. Therefore, the restart feature is not enabled by default. If you
need to enable it, contact the aftersales service or submit a ticket for assistance.

Option 3. Optimize the service
You can troubleshoot the service for optimization.

©2013-2022 Tencent Cloud. All rights reserved.

Page 7 of 7