AWS RDS proxy connection close

0

I have a question about how the rds proxy works. If I close the connection to the proxy endpoint from the application (lambda function), does it also close the underlying database connection (proxy to rds) ? Or it just closes the application to proxy connection and return the database connection back to the pool? If the latter is true, can I safely close the connection from the application when the work is done and request it again when necessary?

1 Respuesta
1
Respuesta aceptada

RDS Proxy is a managed connection pool for RDS. As such, it creates a pool of connections to the database. The clients create the connections to the proxy. There is not a 1-1 relation between client connections and database connections. Whenever a request is received from the client, the proxy will take a connection from the pool, perform the request and return the connection to the pool.

Given the above, your application can create and destroy connections and will have little effect on the database connections. Saying that, it is recommended that you will maintain the connection between your Lambda function and the proxy to reduce execution time.

You can find more information about connections settings here

profile pictureAWS
EXPERTO
Uri
respondido hace 2 años
AWS
EXPERTO
Parnab
revisado hace 2 años
  • Thanks for the clarification. The only reason I wanted to close the application connection was to prevent database connection closed error after long period of inactivity. Now that rds proxy re-uses the db connection during the application idle period, I don’t think there would be any database connection closed errors (need to make sure there is no connection pinning to allow db connection re-use)

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas