https://serverless-stack.com/ logo
#help
Title
# help
j

John

02/25/2022, 8:33 PM
Hi folks, I've followed this guide to start using Aurora in an app I'm building - https://serverless-stack.com/examples/how-to-use-postgresql-in-your-serverless-app.html. This uses the
data-api-client
npm package to handle the requests and connection to the DB. I'm getting some timeouts when using this -
Failed to send response because the Lambda function is disconnected
I'm wondering can I use the AWS SDK RDS Data Client package instead - https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds-data/index.html#aws-sdkclient-rds-data?
n

Noah D

02/26/2022, 2:14 AM
Following
I just started using aurora too and the package you mentioned there too. I'm not 100% sure but i would take a guess at that timeout which is happening is due to the db
autoPause
functionality where it pauses if it isn't being used (see more). And there is likely a startup time for the db which exceeds the lambda timeout length. I personally only notice the error you mentioned if i am running a function for the first time when debugging etc, and that shouldn't be an issue in prod etc since you would want to turn autopause off for those environments. But would be curious to know if you have noticed it in more places.
j

John

02/26/2022, 4:38 PM
Thanks Noah. I've dug around a bit too and it looks like what you say is correct - lambda timeout length. I found this which backs up your idea - https://github.com/serverless-stack/serverless-stack/commit/f5a6f872d51e97f4b4928297212fcbfdb0bc1137 which was merged yesterday 😄 I'm only seeing it on
sst start
too, I'm new to SST and Aurora but if I see this issue happening elsewhere I'll let you know. Thanks.
f

Frank

02/27/2022, 7:59 AM
Thanks @Noah D!
@thdxr what do you think we fire a dummy query (non blocking) on
sst start
to warm up the cluster? What’d be a good dummy query?
t

thdxr

02/27/2022, 3:31 PM
select 1
j

Jay

02/28/2022, 8:13 PM
@Frank let’s turn this into an issue?
j

John

03/02/2022, 9:25 PM
Thanks guys
4 Views