django 1.7和连接池到PostgreSQL? [英] django 1.7 and connection pooling to PostgreSQL?

查看:1051
本文介绍了django 1.7和连接池到PostgreSQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

django应用程序(Django-PostgresPool,djorm-ext-pool,django-db-pool)和PG Bouncer或PG Pool之间有什么不同?



应用程序是否使用最后两个软件包之一?



这篇文章,作者说有一个补丁从django 1.6开始。这是否意味着我们不再需要使用任何这些解决方案,应用程序,PG Bouncer还是PG Pool软件包?

解决方案

与MySQL连接相比,Postgres数据库连接是昂贵的(资源)。 Django池应用程序将打开许多连接并保持打开状态。



PG Bouncer和PG Pool将打开更少的与Postgres的连接,同时保持大量的本地连接(应用程序到PG Bouncer / PG Pool)并重新使用。



为了获得最佳性能,您需要两个:从Django到PG Pool / PG Bouncer的持久连接。



在我们的案例中,切换持续连接将平均响应时间缩短了10ms(超过20%)。


What are the differences between the django apps (Django-PostgresPool, djorm-ext-pool, django-db-pool) and PG Bouncer or PG Pool?

Do the apps use one of the last two packages?

In this article, the author says that there is a patch starting with django 1.6. Does that mean we do not have to use any of these solutions anymore, neither the apps, nor the PG Bouncer or PG Pool package?

解决方案

Postgres database connections are expensive (resources) compared to MySQL connections. Django pooling apps will open many connections and keep the open.

PG Bouncer and PG Pool will open fewer connections to Postgres, while maintaining a large number of local connections (app to PG Bouncer/PG Pool) and reuse them.

For best performance you want both: persistent connections from Django to PG Pool / PG Bouncer.

In our case switching persistent connections reduced average response time by 10ms (over 20%) on AWS.

这篇关于django 1.7和连接池到PostgreSQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆