Django database reconnect
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.
精彩评论