我们有MySQL Amazon RDS生产实例,我们已在亚马逊中激活了错误电子邮件。我们收到了以下电子邮件,我们的MySQL服务器实例已经停止并自动重启。我想知道原因。
错误电子邮件信息是:
reason for State Change: Threshold Crossed: 1 datapoint (201.0) was greater than or equal to the threshold (200.0).
- Timestamp: Sunda
- AWS Account: Threshold:
- The alarm is in the ALARM state when the metric is GreaterThanOrEqualToThreshold 200.0 for 60 seconds.
Monitored Metric:
- MetricNamespace: AWS/RDS
- MetricName: DatabaseConnections " It seems high DB connection reaches in MySQL server.
我们无法找到确切原因。
答案 0 :(得分:2)
您的亚马逊RDS实例配置为最多200个连接。你只需要201个连接,亚马逊让你知道它。您可以阅读有关cloudwatch alarms here in the documentation的更多信息。
对于解决方案,您应确保您的代码正确关闭数据库连接,如果它确实经历了许多同时连接,请将数据库升级到可以处理它的实例。