django 1.7和连接池到PostgreSQL?

编程入门 行业动态 更新时间:2024-10-28 17:14:07
本文介绍了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?

本文发布于:2023-10-15 11:49:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1494248.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接池   django   PostgreSQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!