开发者

Django database reconnect

开发者 https://www.devze.com 2023-01-10 06:08 出处:网络
Django\'s backend (firebird) problem reconnecting to database was fixed as here by disabling request finishing signal. It works on the development server, but when the project was deployed with mod_ws

Django's backend (firebird) problem reconnecting to database was fixed as here by disabling request finishing signal. It works on the development server, but when the project was deployed with mod_wsgi connections it again started to reinit开发者_Go百科ialize for each request. How can I fix it? Thanks.

p.s my connection is very expensive (about 1sec.)


Are you sure that the connections aren't being created from distinct processes. Depending on how you run mod_wsgi then multiple processes could be involved in accepting and handling requests. See:

http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading

Make sure you are using mod_wsgi daemon mode with default of a single process and see if observed behaviour changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消