Django persistent database connection

后端 未结 6 522
太阳男子
太阳男子 2020-11-28 18:22

I\'m using django with apache and mod_wsgi and PostgreSQL (all on same host), and I need to handle a lot of simple dynamic page requests (hundreds per second). I faced with

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 18:33

    Django 1.6 has added persistent connections support (link to doc for latest stable Django ):

    Persistent connections avoid the overhead of re-establishing a connection to the database in each request. They’re controlled by the CONN_MAX_AGE parameter which defines the maximum lifetime of a connection. It can be set independently for each database.

提交回复
热议问题