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回答
1
承認された回答

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
エキスパート
Uri
回答済み 2年前
AWS
エキスパート
Parnab
レビュー済み 2年前
  • 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)

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ