Wiadomość napisana w dniu 2009-12-10, o godz. 13:41, przez Alexander Dutton:
> As of last Thursday we've been seeing ~100% CPU usage from Apache, > which > we believe was caused by Debian Bug #528529[0], whereby psycopg2 was > attempting to double free pointers, resulting in segfaults. This was > then (we think) leaving database connections open, resulting in > postgres > saying "no more connections, TYVM" and the whole site 500ing. Not > good. > > On Monday we worked out what was happening and pulled psycopg2 2.0.12 > from PyPI, as the bugfix hasn't been backported to Debian Lenny. > Everything seemed happy, but now we're seeing similar symptoms again > and > were wondering if anyone else could help. > > Versionwise, we have: > * Django 1.1 > * Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] > * Debian Lenny > * psycopg2 2.0.12-py2.5-linux-i686 > * postgresql 8.3.8 I got into similar problem once or twice, with another versions of database software (even with psycopg1). The problem came from using django.db.connection for ad-hoc queries and not closing the transaction manually. Two solutions, both worked fine: stop using django.db.connection for ad-hoc queries (just connect to postgresql manually using plain DB-API provided by driver, either psycopg1 or psycopg2) or after any select query call (harmless anyway in such case) connection._rollback(). I never had such problem when using only Django ORM. -- Artificial intelligence stands no chance against natural stupidity Jarek Zgoda, R&D, Redefine jarek.zg...@redefine.pl -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.