gpt4 book ai didi

mysql - AWS Aurora Serverless - 通信链路故障

转载 作者:行者123 更新时间:2023-12-02 22:03:09 24 4
gpt4 key购买 nike

我在 python 代码中使用 MySQL Aurora Serverless 集群(启用了数据 API),但收到通信链路故障异常。当集群休眠一段时间后,通常会发生这种情况。

但是,一旦集群处于事件状态,我就不会收到任何错误。我每次必须发送 3-4 个请求才能正常工作。

异常详细信息:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. An error occurred (BadRequestException) when calling the ExecuteStatement operation: Communications link failure

如何解决这个问题?我正在使用标准 boto3 库

最佳答案

这是 AWS 高级业务支持的回复。

Summary: It is an expected behavior

详细答案:

I can see that you receive this error when your Aurora Serverless instance is inactive and you stop receiving it once your instance is active and accepting connection. Please note that this is an expected behavior. In general, Aurora Serverless works differently than Provisioned Aurora , In Aurora Serverless, while the cluster is "dormant" it has no compute resources assigned to it and when a db. connection is received, Compute resources are assigned. Because of this behavior, you will have to "wake up" the clusters and it may take a few minutes for the first connection to succeed as you have seen.

In order to avoid that you may consider increasing the timeout on the client side. Also, if you have enabled Pause, you may consider disabling it [2]. After disabling Pause, you can also adjust the minimum Aurora capacity unit to higher value to make sure that your Cluster always having enough computing resource to serve the new connections [3]. Please note that adjusting the minimum ACU might increase the cost of service [4].

Also note that Aurora Serverless is only recommend for certain workloads [5]. If your workload is highly predictable and your application needs to access the DB on a regular basis, I would recommend you use Provisioned Aurora cluster/instance to insure high availability of your business.

[2] Aurora Serverless 的工作原理 - Aurora Serverless 自动暂停和恢复 - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.pause-resume

[3] 设置 Aurora Serverless 数据库集群的容量 - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.setting-capacity.html

[4] Aurora Serverless 价格 https://aws.amazon.com/rds/aurora/serverless/

[5] 使用 Amazon Aurora Serverless - Aurora Serverless 用例 - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.use-cases

关于mysql - AWS Aurora Serverless - 通信链路故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58192747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com