We have an application that has a django front end and a bunch of
backend stuff that uses django's excellent database api.

We've developed using sqlite and recently switched to the postgres back
end.

We leak database sessions and eventually run out of postgres's 100
sessions after several hours.

I notice that there are lots of sessions with open transactions.
Perhaps auto transactions doesn't work in some circumstances?

Our application has several processes and they use threads to do work.
Some threads live for the life of the app (while True blah) and other
threads are started to do some task and then end when it's done.

Note that we call .setDaemon(True) in our threads so that all ends
nicely when we kill the process.

Now, the good news is that by explicitly calling connection.close()
after doing any inserts or updates the leaks have stopped, but this
shouldn't be required and of course in loops it has a big overhead
disconnecting and re-connecting. My suspicion is that this "fix" just
hides the real problem.

Tailing the sql going through postgres I see examples of transaction
BEGINs without ENDs, but it's hard to tell in a very threaded app. (We
have 18 threads going mostly).

We're on 0.95 but can't see any evidence of a fix after this.

Does any one have a similar problem or know of a fix?

We love using django by the way. I've never been so productive.

Peter


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to