Dear fellow Django users, We're beginning to be at wits end with a particular problem that we're having that I suspect has to do with server configuration issues, but might be something else.
Our Django processes (whether it be Apache when running mod-python or independent daemons when running mod_wsgi in daemon mode) begin to consume CPU shortly after the server is started. I expect to see short spikes in CPU usage when requests occur, with some very small amount (single-digit %) when there are no requests occurring. Instead, we get a slowly increasing constant load on the CPU that eventually begins to affect the performance of the site. Restarting the server makes the problem go away, but it returns after a few requests have been made. I've been unable to replicate this problem when running Django locally on my computer, with wsgi or with manage.py runserver. Because the CPU consumption comes from the mod_wsgi daemon processes, I am quite sure that the problem lies somewhere in Python and not in an Apache module or in Postgres. As I can't replicate this problem locally, I've tried profiling the site on our actual server by running a second instance of Apache and mod_wsgi with the repoze.profile WSGI middleware. This middleware appears to work just fine, but I've not yet been able to replicate the problem when running it. Additionally, repoze.profile starts recording profile data when a request begins, and stops when the request is done. It strikes me as possible that it may not even record data on a long-running CPU hog if I can create it. I have two questions for you all: 1. Is there a good way to use cProfile or hotshot on the _entire_ WSGI application rather than as a per-request middleware while running under mod_wsgi? cProfile's restriction that it must be called with a string that is eval'd seems to make this impossible, but I'm quite new to WSGI configuration so I might be missing something obvious. Hotshot would seem to have the same problem, even though it wants a callable rather than a string. 2. Has anyone else here experienced anything similar who could shed some light on my situation? Many thanks in advance! /David Christiansen -- 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.