RDS Postgres Aurora Sereverless 2 Times Out

0

We've ran into an issue switching Amazon RDS Postgres to Amazon Aurora Postgres Serverless v2 in production.

Switching application to the Serverless Writer instance caused significant performance degradation after about 5 hours. The issue seems to stem from a problem with the database connection to the instance, but the root cause is still unclear.

Our NewRelic monitoring showed three Response time spikes but no there were no corresponding issues in AWS RDS itself. Upon closer inspection, we found that some connections were established really slowly, and some of them even had to be retried twice. During the most significant spike, we also encountered "SQLSTATE[08006] [7] timeout expired" errors for simple and quick SQL queries.

NewRelic Response time spikes

NewRelic Connection To RDS

NewRelic Connection Retry Attempt

However, the issues disappeared as soon as we switched back to a static, non-serverless instance.

Strage thing is there is no clear correlation between performance degradation and the number of capacity units. During the time the issues were occurring, the number of capacity units was set from 0.5 to 128, but only 45 ACU were actually used.

AWS RDS ACU Utilization

AWS RDS Read-Write Latency

We do not believe this is a configuration issue since we are currently using the same cluster with the same version, configuration and cluster endpoints.

Has anyone experienced similar problem with Serverless v2? Any ideas what to try?

1 Answer
0

Yes, we do have the same issue, operation that takes usually ~200ms sometimes hangs to (log from few minutes ago) 16151.608 ms...

And throws exception "timeout expired".

We use aws ECS (fargate instances) with nodeJS to connect to aws aurora with psql. I'm looking for possible solutions but nothing so far..

EDIT: I tried setting values for pool

  keepAlive: true,
  keepAliveInitialDelayMillis: 20000,
  poolIdleTimeout: 600000,

And setting minimal connection amount/maximum, played around with it.. but with no success either...

bmxpiku
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions