MagicStack / MagicStack/asyncpg
Making pool connection cycling async
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 8.1k
- Forks
- 468
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
* **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](https://github.com/magicstack/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?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par lire le point d’entrée Pool.connect et les options existantes du pool pour faire tourner les connexions de manière proactive. Suivez le moment où l’établissement de la connexion se produit pour les requêtes entrantes et déterminez les changements nécessaires pour effectuer cette rotation en arrière-plan ; le travail est terminé lorsque les clients du pool ne subissent plus cette latence d’établissement de connexion.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- postgresql, python
- Domaine
- backend, databases
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100