The RDS command group provides tools for managing and troubleshooting Amazon RDS instances, with specialized support for MySQL connection issues.
Analyze MySQL RDS instances for connection-related issues, including the common “too many connections” error.
aws-cloud-utilities rds troubleshoot-mysql <DB_INSTANCE_IDENTIFIER> [OPTIONS]
DB_INSTANCE_IDENTIFIER: The RDS instance identifier to troubleshoot--output-file FILE: Save detailed results to a JSON file--profile PROFILE: AWS profile to use--region REGION: AWS region--output FORMAT: Output format (table, json, yaml, csv)# Basic troubleshooting
aws-cloud-utilities rds troubleshoot-mysql my-mysql-db
# Save detailed results to file
aws-cloud-utilities rds troubleshoot-mysql my-mysql-db --output-file mysql-analysis.json
# Use specific profile and region
aws-cloud-utilities rds troubleshoot-mysql my-mysql-db --profile production --region us-west-2
List RDS instances in the current region with optional filtering.
aws-cloud-utilities rds list-instances [OPTIONS]
--engine ENGINE: Filter by database engine (mysql, postgres, etc.)--status STATUS: Filter by instance status (available, stopped, etc.)# List all RDS instances
aws-cloud-utilities rds list-instances
# List only MySQL instances
aws-cloud-utilities rds list-instances --engine mysql
# List only available instances
aws-cloud-utilities rds list-instances --status available
This error occurs when the number of concurrent connections exceeds the max_connections parameter value.
Common causes:
max_connections settingSolutions:
max_connections parameterIndicates connections being terminated unexpectedly.
Common causes:
Solutions:
max_connections: Maximum number of concurrent connectionsconnect_timeout: Connection establishment timeoutwait_timeout: Time to wait for activity on a connectioninteractive_timeout: Timeout for interactive connectionsthread_cache_size: Number of threads to cache for reuse# Database connections approaching limit
DatabaseConnections > 80% of max_connections
# High aborted connections
AbortedConnections > 10 per 5 minutes
# High connection attempts
ConnectionAttempts > normal baseline + 50%
Enable Performance Insights for detailed analysis of:
aws-cloud-utilities rds troubleshoot-mysql your-db-instance
The RDS troubleshooting tool integrates with:
Provides a clean, readable summary with color-coded recommendations.
Detailed machine-readable output suitable for automation and further analysis.
Save complete analysis results to a JSON file for:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds:DescribeDBInstances",
"rds:DescribeDBParameters",
"rds:DescribeDBLogFiles",
"rds:DownloadDBLogFilePortion",
"cloudwatch:GetMetricStatistics"
],
"Resource": "*"
}
]
}