I have a lambda function that connects to RDS instance using AWS RDS Proxy. I occasionally get timeout errors when connecting to RDS DB instance. I have plenty of connections in the pool. I use rds proxy userid & pass to connect
ERROR:
{
"errorType": "Error",
"errorMessage": "connect ETIMEDOUT",
"code": "ETIMEDOUT",
"errorno": "ETIMEDOUT",
"syscall": "connect",
"fatal": true,
"stack": [
"Error: connect ETIMEDOUT",
" at Connection._handleTimeoutError (/var/task/node_modules/mysql2/lib/connection.js:178:17)",
" at listOnTimeout (internal/timers.js:554:17)",
" at processTimers (internal/timers.js:497:7)"
]
}
I use nodejs 12 version and mysql2 for db access. SQS queue is added as a trigger to Lambda and it processes the messages received from the queue
There is no issue with the security groups. Lambda and RDS Proxy is part of the same security Group. Moreover this timeout happens only few times. How do i debug this issue?