Should PostgreSQL connections be pooled in a Python web app, or create a new connection per request?

前端 未结 5 553
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 17:26

I\'m building a web app in Python (using Flask). I do not intend to use SQLAlchemy or similar ORM system, rather I\'m going to use Psycopg2 directly.

Should I open a new

5条回答
  •  南旧
    南旧 (楼主)
    2021-02-04 18:10

    PgBouncer is pretty neat and transparent to the application and server.

    We have been using PgBouncer in production for 2 years without a single issue. It's a pretty awesome PostgreSQL connection pooler.

    http://wiki.postgresql.org/wiki/PgBouncer

提交回复
热议问题