MagicStack / MagicStack/asyncpg
Making pool connection cycling async
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 8.1k
- 派生
- 468
- PR 合并指标
- 30 天内没有已合并 PR
描述
- asyncpg version: 0.14
- PostgreSQL version: 9.5/9.6
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: AWS RDS - Python version: 3.6
- Platform: linux in docker
- Do you use pgbouncer?: Not in this instances
- Did you install asyncpg with pip?: yes
- If you built asyncpg locally, which version of Cython did you use?:
- Can the issue be reproduced under both asyncio and
uvloop?: We only use asyncio
We have some application containers that use asyncpg connection pools, every now and again my performance tracing on our application request handlers shows that the connect method in the Pool takes a significant amount of time (sometimes 150ms) when establishing a connection to our RDS postgres instance (same Region).
The Pool has options to control how often a connection is pro-actively cycled, but my concern is that this results in clients of the pool having to wait for a connection to be established - I would much rather push this into a background async task who's job it is to take connections in/out of service so that inbound http requests to our server never incur the latency of performing the connection themselves.
Is this already doable or would it require some changes to asyncpg?
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 Pool.connect 入口点以及用于主动轮换连接的现有池选项。跟踪传入请求的连接建立发生在何时,并确定后台轮换需要进行哪些更改;完成的标准是池客户端不再承担该连接建立延迟。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- postgresql, python
- 领域
- backend, databases
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100