Document Database Service
Document Database Service
- What's New
- Function Overview
- Service Overview
-
Getting Started
- Overview
- Getting Started with Clusters
- Getting Started with Replica Sets
- Getting Started with Single Nodes
- Logging In to the DDS Console
- Example: Buying and Connecting to a DDS Instance
- Change History (Getting Started) Europe Site
-
User Guide
- Migrating Data
- Performance Tuning
- Permissions Management
- Instance Lifecycle Management
- Instance Modifications
- Data Backups
- Data Restorations
-
Parameter Template Management
- Overview
- Creating a Parameter Template
- Modifying a Parameter Template
- Viewing Parameter Change History
- Exporting a Parameter Template
- Comparing Parameter Templates
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying the Description of a Parameter Template
- Deleting a Parameter Template
- Connection Management
- Database Usage
- Data Security
- Monitoring and Alarm Reporting
- Auditing
- Logs
- Task Center
- Billing
- Tags
- Quotas
- DDS Usage Suggestions
- Change History
- Developer Guide
-
Best Practices
- Overview
- Common Methods for Connecting to a DDS Instance
- How Do Replica Sets Achieve High Availability and Read/Write Splitting?
- Sharding
- How Do I Improve DDS Performance by Optimizing SQL Statements?
- How Do I Prevent the Mongos Cache Problem?
- How Do I Solve the High CPU Usage Issue?
- Creating a User and Granting the Read-Only Permission to the User
- Security White Paper
- Performance White Paper
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
APIs V3.0 (Recommended)
- Querying the API Version
- Querying Database Version Information
- Querying Database Specifications
- Querying the Database Disk Type
-
DB Instance Management
- Creating a DB Instance
- Restarting a DB Instance
- Deleting a DB Instance
- Querying Instances and Details
- Scaling Up Storage Space
- Adding Nodes for a Cluster Instance
- Modifying DB Instance Specifications
- Performing a Primary/Secondary Switchover in a Replica Set Instance
- Enabling or Disabling SSL
- Modifying a DB Instance Name
- Changing an Instance Description
- Changing a Database Port
- Changing a Security Group
- Binding an EIP
- Unbinding an EIP
- Changing a Private IP Address
- Creating Shard or Config IP Addresses of a Cluster Instance
- Configuring Cross-CIDR Access for a Replica Set
- Querying AZs to Which an Instance Can Be Migrated
- Migrating a DB Instance to Another AZ
- Adding Nodes to a Replica Set Instance
- Adding a Read Replica to an Instance
- Connection Management
-
Backup and Restoration
- Creating a Manual Backup
- Deleting a Manual Backup
- Querying the Backup List
- Querying an Automated Backup Policy
- Setting an Automated Backup Policy
- Restoring Data to a New DB Instance
- Obtaining the Link for Downloading a Backup File
- Querying the Restoration Time Ranges
- Obtaining the List of Databases That Can Be Restored
- Obtaining the List of Database Collections That Can Be Restored
- Restoring Data to the Original DB Instance
- Restoring Databases and Tables to a Point in Time
- Parameter Configuration
- Log Information Queries
- Tag Management
-
Managing Databases and Users
- Creating a Database User
- Creating a Database Role
- Querying Details About Database Users
- Querying the Database Role List
- Changing the Password of a Database User
- Checking the Password for Logging In to a Database
- Querying Cluster Balancing Settings
- Enabling or Disabling Cluster Balancing
- Setting the Activity Time Window for Cluster Balancing
- Deleting a Database User
- Deleting a Database Role
- Quota Management
- Task Management
- API V3 (Unavailable Soon)
- Examples
- Permissions Policies and Supported Actions
- Appendix
- Change History (European Sites)
- SDK Reference
-
FAQs
-
Product Consulting
- What Is the Relationship Between DDS and MongoDB Community Edition?
- What Are the Differences Between DDS and GaussDB(for Mongo)?
- What Precautions Should Be Taken When Using DDS?
- What Is the Availability of DDS DB Instances?
- Will My DDS DB Instances Be Affected by Other Users' DDS DB Instances?
- Does DDS Support Multi-AZ Deployment?
- Can I Change the VPC for a Created Instance?
- Can I Change the Region for a Created Instance?
- What Is Hidden Node?
- Database Versions
-
Resource and Disk Management
- Which Items Occupy the Storage Space of DDS Instances?
- Which Types of Logs and Files Occupy DDS DB Instance Storage Space?
- Why Is the Storage Space Usage Displayed on the GUI Smaller Than the Actual Usage?
- Why Does Available Disk Space Not Increase After Data Is Deleted?
- Why Is the Resident Memory of a 4 vCPUs/8 GB Memory Replica Set Instance Only 4 GB?
- Capacity Expansion and Specification Changes
-
Database Performance
- When Will a Primary/Standby Switchover Be Triggered for a Cluster or Replica Set?
- High Storage Usage
- What Is the Time Delay for Primary/Secondary Synchronization in a Replica Set?
- How Is Data Transferred Between the Primary and Secondary Nodes of a Replica Set?
- How Do I Clear an Alarm Saying the Shard Memory Usage Exceeds 90%?
- What Can I Do If a Query Error Is Reported After Data Is Written Into the DDS Cluster?
- Database Permissions
-
Creation and Deletion
- How Do I Select Instance Specifications and Nodes?
- Why Is an Instance Not Displayed on the Console After It Is Created?
- Can I Use a Template to Create DDS DB Instances?
- Why Is Data Missing from My Database?
- Will My Backups Be Deleted If I Delete My Cloud Account?
- What Are the Differences Between Instance Deletion and Unsubscription?
-
Database Connection
- What Should I Do If I Fail to Connect to a DDS Instance?
- What Can I Do If the Number of Connections of an Instance Reaches Its Maximum?
- How Do I Query and Limit the Number of Connections?
- What Should I Do If the ECS and DDS Are Deployed in Different VPCs and They Cannot Communicate with Each Other?
- Do Applications Need to Support Automatic Reconnecting to the DDS Database?
- How Do I Create and Log In to an ECS?
- Installing a Client
- Database Usage
- Database Migration
- Database Storage
- Database Parameters
- Backup and Restoration
- Network Security
- Monitoring and Alarm
- Change History (FAQs) Europe Site
-
Product Consulting
-
Troubleshooting
- DDS Instance Node Fault Handling Mechanism
- Connection Failure Message: network error while attempting to run command 'isMaster'
- Connection Failure Messages: No route to host and connection attempt failed
- Connection Failure Message: Authentication failed
- Connection Failure Message: couldn't connect to server
- Connection Failure Message: cannot list multiple servers in URL without 'replicaSet' option
- Connection Failure Message: Timeout while receiving message
- Connection Failure Message: exception: login failed and U_STRINGPREP_PROHIBITED_ERROR
- Change History (Troubleshooting) European Sites
- Videos
On this page
Slow Query Logs
Updated on 2023-03-15 GMT+08:00
Slow query logs record statements that exceed operationProfiling.slowOpThresholdMs (500 seconds by default). You can view log details and statistics to identify statements that are executing slowly and optimize the statements. You can also download slow query logs for service analysis.
Precautions
- Community Edition instances allow you to view and export log details, enable Show Original Log, and download log files on the management console.
- The Show Original Log function cannot be enabled when you delete DB instances, add nodes, change DB instance class, rebuild secondary node, or the DB instance is frozen.
- If Show Original Log is being enabled, you cannot delete instances, add nodes, or change instance class.
- The default threshold of slow query logs is 500 ms. If the execution time of a statement exceeds the threshold, a slow query log is recorded in the system.profile table in the current database.
- The attribute of the slow query log table system.profile is capped. When the size of the table reaches a specified threshold, old data is automatically deleted. If you need to analyze slow query logs, download the logs on the console in a timely manner.
Parameter description
Parameter |
Description |
---|---|
operationProfiling.mode |
Specifies database profiling (analysis) level. The default value is slowOp.
|
operationProfiling.slowOpThresholdMs |
Queries that exceed the threshold in the unit of ms are deemed slow. The default value is 500 ms. Unless otherwise specified, keeping the default value is recommended. |
Enabling Show Original Log
- If Show Original Log is enabled, original logs are displayed. By default, the system automatically deletes original logs after 30 days, and the period cannot be changed.
- If the instance a slow query log belongs to is deleted, related logs are deleted along with it.
- Show Original Log can be disabled after it is enabled. The slow query logs reported before the function is disabled are displayed. The slow query logs reported after the function is disabled are not displayed.
- Log in to the management console.
- Click
in the upper left corner and select a region and a project.
- Click
in the upper left corner of the page and choose Databases > Document Database Service.
- On the Instances page, click the instance name.
- In the navigation pane on the left, choose Slow Query Logs.
- On the displayed page, click Slow Query Logs. Then, click
on the Log Details tab.
Figure 1 Enabling Show Original Log - In the displayed dialog box, click Yes to enable the function of slowing original logs.
Viewing and Exporting Log Details
- Log in to the management console.
- Click
in the upper left corner and select a region and a project.
- Click
in the upper left corner of the page and choose Databases > Document Database Service.
- On the Instances page, click the instance name.
- In the navigation pane on the left, choose Slow Query Logs.
- On the Slow Query Logs page, set search criteria on the Log Details tab and click Search to view log information.
Figure 2 Querying slow query logs
- Log records of all shards of a cluster instance
- Log records of all nodes in a replica set instance
- Slow query logs of a node in different time periods
- Slow query statements of the following levels
- All statement type
- INSERT
- QUERY
- UPDATE
- REMOVE
- GETMORE
- COMMAND
- KILLCURSORS
- You can view up to 2,000 slow logs of a specified node type, at a specified level, and within a specified period.
- On the Log Details tab, click Advanced Search.
Figure 3 Advanced search
- Specify Keyword, Execution Time (ms), Database, and Table, and click Search to view log information.
Figure 4 Setting advanced search parameters
- To clear the parameter settings of Advanced Search, click Reset.
Figure 5 Resetting advanced search parameters
- On the Log Details tab, click
in the upper right corner of the log list to export log details.
- View the .csv file exported to your local PC.
- Up to 2,000 log details can be exported at a time.
Downloading Logs
- Log in to the management console.
- Click
in the upper left corner and select a region and a project.
- Click
in the upper left corner of the page and choose Databases > Document Database Service.
- On the Instances page, click the instance name.
- In the navigation pane on the left, choose Slow Query Logs.
- On the Slow Query Logs page, click the Log Files tab. Locate a log whose status is Preparation completed and click Download in the Operation column.
Figure 6 Slow Query Logs
- The system automatically loads the downloading preparation tasks. The time required depends on the log file size and the network environment.
- During the downloading preparation, the log status is Preparing.
- Once the logs are ready for download, the log status changes to Preparation completed.
- If the downloading preparation fails, the log status is Abnormal.
- You can download only one log file from a node. The maximum size of a log file to be downloaded is 40 MB.
- The download link is valid for 5 minutes. After the download link expires, a message is displayed indicating that the download link has expired. To download the log, click OK.
- The system automatically loads the downloading preparation tasks. The time required depends on the log file size and the network environment.
Reference
Parent topic: Logs
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.